You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Mark de Leon (JIRA)" <ji...@apache.org> on 2017/11/02 07:25:00 UTC

[jira] [Closed] (CAMEL-11480) camel-rabbitmq - autorecovery creates additional channels

     [ https://issues.apache.org/jira/browse/CAMEL-11480?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mark de Leon closed CAMEL-11480.
--------------------------------
    Estimated Complexity: Moderate  (was: Unknown)

> camel-rabbitmq - autorecovery creates additional channels
> ---------------------------------------------------------
>
>                 Key: CAMEL-11480
>                 URL: https://issues.apache.org/jira/browse/CAMEL-11480
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-rabbitmq
>    Affects Versions: 2.19.1
>         Environment: rabbitmq server 3.6.2 running on cluster+HA mode (2 nodes), Spring client application using DSL camel configuration
>            Reporter: Mark de Leon
>            Priority: Minor
>             Fix For: 2.20.0
>
>
> While testing the automatic recovery for rabbitmq for network failure scenario, I noticed that after recovery, the consumer/channel count is always increasing.
> Consider the following codes:
> <camel:route id="in_route">
> 			<camel:from uri="rabbitmq://rabbitmq/myexchange?connectionFactory=#rabbitMqCustomConnectionFactory&amp;addresses={{rabbitmq.nodes}}&amp;queue=myqueue" />
> 			<camel:to uri="log:message received?showBody=true" />
> 		</camel:route>
> // Custom connection factory
> <bean id="rabbitMqCustomConnectionFactory" class="com.rabbitmq.client.ConnectionFactory">
> 	<property name="username" value="${rabbitmq.username}" />
> 	<property name="password" value="${rabbitmq.password}" />
> </bean>
> When the application runs, I see 2 threads running:
> * RabbitMQConsumer [camel-rabbitmq library]
> * AMQConnection (RecoveryAwareAMQConnection) [amqp-client]
> Killing the active rabbitmq server node triggers the auto recovery in the client.
> * RabbitConsumer.handleShutdownSignal() successfully reconnects to the other rabbitmq node. 
> * At the same time, AutorecoveringConnection.beginAutomaticRecovery is triggered but with some networkRecoveryInterval delay - recovers successfully any existing channels.
> As a result, 2 channels/consumers are created - both are active. When there should only be 1 channel to be recovered.
> Would it be possible to add a priority whether which recovery mechanism to use? Was thinking of having the AMQConnection recovery execute first before the RabbitConsumer recovery since the latter checks if an existing channel is open before creating a new connection.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)