[rabbitmq-discuss] java client reconnect error: attempt to reuse consumer tag

James Bellenger james at bellenger.org
Sat Apr 12 21:32:57 BST 2014


Thanks for the pointer, Michael.
In looking at the client code again, 
AutorecoveringConnection.recoverConsumers modifies the consumer map 
while iterating over it. This can change the map ordering and lead to 
recovering the same consumer twice. It looks like a similar thing 
happens in recoverQueues. I've attached a small patch that fixes the 
issue.

Thanks!
James


On 2014-04-12 03:36, Michael Klishin wrote:
>  On 12 April 2014 at 02:39:53, James Bellenger (james at bellenger.org) 
> wrote:
>> > On my machine, recovery appears to work at fewer than about 5
>> consumers. Anything over that, and the client gets a stream of
>> TopologyRecoveryExceptions and is never able to reconnect.
>
> This is annoying but reconnection happens before topology recovery, 
> so
> it is able to reconnect.
>
>> I've looked at the client source and haven't seen any obvious
>> culprit.
>
> I cannot immediately say what may be going here but there is one
> default = 5 in the client.
>
> ConsumerWorkService uses a 5 thread executor by default (instantiated
> with Executors.newFixedThreadPool). Try setting a custom executor 
> that
> has, say, 64 threads and configure ConnectionFactory with it, and let 
> us know
> how it goes.
> --
> MK
>
> Software Engineer, Pivotal/RabbitMQ
-------------- next part --------------
A non-text attachment was scrubbed...
Name: recovery.patch
Type: text/x-java
Size: 1411 bytes
Desc: not available
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20140412/00154df2/attachment.java>


More information about the rabbitmq-discuss mailing list