[rabbitmq-discuss] auto_delete queues not going away

Matthias Radestock matthias at lshift.net
Thu Nov 5 23:02:57 GMT 2009


Tim,

Tim Cole wrote:
> I'm having some difficulty with queues not going away even after their
> last consumer has gone.  The orphaned queues stick around and fill up
> with messages until the RabbitMQ server has to be restarted or the
> queues manually deleted.
> 
> For example, `rabbitmqctl name messages consumers` shows lots of entries
> like:
> 
>  notify.a388d3c7-c501-4fef-92bb-516710950f4a	7198	0
> 
> (With the 'messages' column quickly growing in size...)
> 
> These queues were created with durable=True, exclusive=True, and
> auto_delete=True.  It had been my understanding that the last option
> bit, auto_delete, would ensure that the queue would be deleted once
> there were no more consumers, but that doesn't appear to actually be the
> case.

Marking an exclusive queue as durable is quite a strange thing to do, 
since 'exclusive' means the queue should go away when the creating 
connection dies, such as during a broker restart, but 'durable' means it 
should survive broker restarts.

There is in fact a known problem with durable, exclusive queues - if the 
server restarts it is possible that these queues survive even though 
their owning connections are dead.

So I suggest dropping the 'durable' flag.

Also note that auto_delete only kicks in only after the queue has had at 
least one consumer registered with basic.consume. basic.get doesn't count.

And exclusivity is attached to the *connection*, not the channel, so 
it's worth checking that the connection(s) which created the queues are 
indeed dead.


Regards,

Matthias.




More information about the rabbitmq-discuss mailing list