[rabbitmq-discuss] Trying to handle ConnectionShutdown event

Bernhard Mogens Ege bme at saseco.dk
Wed Nov 28 13:40:38 GMT 2012


Yeah, that is the problem. My code does uses the original name as a handle (was assuming when I started that the queueName was static). Fortunately I have encapsulated all RabbitMQ calls in its own class so I can work around this problem. I just hoped I didn't have to.

Thanks,
Bernhard

-----Original Message-----
From: Matthias Radestock [mailto:matthias at rabbitmq.com] 
Sent: 28. november 2012 14:20
To: Discussions about RabbitMQ
Cc: Bernhard Mogens Ege
Subject: Re: [rabbitmq-discuss] Trying to handle ConnectionShutdown event

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