[rabbitmq-discuss] Trying to handle ConnectionShutdown event

Matthias Radestock matthias at rabbitmq.com
Wed Nov 28 13:19:44 GMT 2012


Berhard,

On 28/11/12 13:05, Bernhard Mogens Ege wrote:
> But I do want the queues to auto-delete. The exclusive part is
> negotiable, but auto-delete is required. I guess I could create a
> mapping from the original name to the new name (that will be
> auto-generated with QueueDeclare()). A bit annoying but if that is
> how I can get the auto-delete, so be it.

Auto-deletion is only useful when there can be multiple consumers. Those 
multiple consumers would all need to know the queue name. Which usually 
implies it is known in advance, rather than server-generated and then 
shared.

By contrast, if the queue is exclusive then it will get deleted when the 
connection closes. Server-named queues work well here. When 
reconnecting, simply declare a queue the same way as you did initially, 
i.e.let the server pick a (new) name. For that to work, obviously none 
of your code must hold on to the original name.

Regards,

Matthias.


More information about the rabbitmq-discuss mailing list