[rabbitmq-discuss] Handling Consumer Cancel Notifications in Java Client

Chris stuff at moesel.net
Fri Aug 9 03:51:55 BST 2013


I understand that in the event of a master queue going down, a consumer
cancel notification will be sent to all consumers.  Upon receiving the
notification, the consumer can re-consume from the queue (the newly
promoted master queue of course).

I have a consumer that is a subclass of the Java DefaultConsumer.  I'm
having trouble figuring out exactly how to reconsume from the queue.
 Whenever I try to do anything with the channel in my "handleCancel" method
implementation, it blocks forever.  I'm guessing there is a lock on the
channel while I'm in that method, and that lock that prevents me from
redeclaring queues or consuming from them?  It seems, however, I can't even
create a new channel when I'm in that "handleCancel" method.

What is the recommended way for reconsuming?  Do I need to spawn another
thread to do it asynchronously?  That doesn't seem right, but I'm out of
ideas... Or am I missing something really obvious?  I feel like that is
probably more likely. ;-)

Thanks for any pointers!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20130808/bc9a65bd/attachment.htm>

More information about the rabbitmq-discuss mailing list