[rabbitmq-discuss] shutdownCompleted is not called when queue is deleted

Matthias Radestock matthias at rabbitmq.com
Sun Aug 11 19:37:03 BST 2013


On 06/08/13 20:48, jchappelle wrote:
> I have implemented a Consumer that extends DefaultConsumer. When I delete my
> queue using the web interface it fires the handleCancel event in my consumer
> but it does not call shutdownCompleted in the class that is managing my
> connections. I'm trying to make my application fault tolerant so that it
> will re-connect in this case. I throw a ConsumerCancelledException in my
> handleCancel method thinking that the DefaultExceptionHandler will close the
> channel and ultimately fire the event that calls the shutdownCompleted
> method but this does not happen.

You may want to try closing the connection with connection.close() (from 
a separate thread, due to 
http://rabbitmq.1065348.n5.nabble.com/Handling-Consumer-Cancel-Notifications-in-Java-Client-tc28688.html)

Btw, it is not clear to me why you want to close the connection. The 
connection and channel are still alive and healthy; if you want to, say, 
create another queue & consumer, that could be done on the existing 
connection/channel.

Matthias.



More information about the rabbitmq-discuss mailing list