[rabbitmq-discuss] Multiple subscription in the same thread

Wilson, Roger roger.wilson at lehman.com
Tue Feb 17 14:19:48 GMT 2009

This is the subscription code...

consumerTag = new Long(_consumerTagCounter++).toString();
_logger.info(String.format("Starting registration of consumer for
dispatch %s and consumer tag %s", _queueName, consumerTag));
_channelAMQP.basicConsume(_queueName, false, consumerTag, false, false,
_logger.info(String.format("Completed registration of consumer for
dispatch %s and consumer tag %s", _queueName, consumerTag));

This is within a Consumer derived object.  When the above snippet sat in
a loop over two queues it would often hang on the second subscription.
I have since adapted the code to use a topic subscription, side stepping
the issue.  Just wondering if it should have worked.


-----Original Message-----
From: Tony Garnock-Jones [mailto:tonyg at lshift.net] 
Sent: 17 February 2009 14:11
To: Wilson, Roger
Cc: rabbitmq-discuss at lists.rabbitmq.com
Subject: Re: [rabbitmq-discuss] Multiple subscription in the same thread

Wilson, Roger wrote:
> This tends to work for a few calls and then when calling 
> Channel.basicConsume for the second queue it hangs.  Always the second

> queue.

The hang is unusual. That shouldn't happen. Are you using
server-generated or your own consumer tags? (Phrased differently: which
overload of Channel.basicConsume are you using, and if it's the one with
an explicit consumer tag, how are you building the consumer tag string?)

 [][][] Tony Garnock-Jones     | Mob: +44 (0)7905 974 211
   [][] LShift Ltd             | Tel: +44 (0)20 7729 7060
 []  [] http://www.lshift.net/ | Email: tonyg at lshift.net

This message is intended only for the personal and confidential use of
the designated recipient(s) named above.  If you are not the intended
recipient of this message you are hereby notified that any review,
dissemination, distribution or copying of this message is strictly
prohibited.  This communication is for information purposes only and
should not be regarded as an offer to sell or as a solicitation of an
offer to buy any financial product, an official confirmation of any
transaction, or as an official statement of Lehman Brothers.  Email
transmission cannot be guaranteed to be secure or error-free.
Therefore, we do not represent that this information is complete or
accurate and it should not be relied upon as such.  All information is
subject to change without notice.

More information about the rabbitmq-discuss mailing list