[rabbitmq-discuss] when are auto_delete queues actually deleted?

Scott Brooks scott.brooks at epicadvertising.com
Thu Nov 19 13:06:05 GMT 2009


On 2009-11-19, at 6:01 AM, Matthias Radestock wrote:

> Gojko,
> 
> Gojko Adzic wrote:
>> so this is a bug then?
>> 
>> -bash-3.2# rabbitmqctl list_queues name auto_delete consumers | grep 0$
>> amq.gen-v6OnaGmZrKj3vDNWy3B0pA==        true    0
>> amq.gen-meDIMMmWVzZlgNIYmWySJg==        true    0
>> amq.gen-+kWwe8PtGrO/4AtsqwzqJg==        true    0
>> amq.gen-0vOWLk96SDEWD6rcLG9H1A==        true    0
>> amq.gen-FFEHkUo6lzYTmvXXt2evSg==        true    0
>> amq.gen-Z8Ob8BZDJFBNPXoN7oyV4g==        true    0
>> amq.gen-1d9lXsBZwiTM/tVG3cUcug==        true    0
>> amq.gen-OyEzVIng+Z8LgXaF/sXTlA==        true    0
>> amq.gen-Vl3QAu0kbw+WJYZJSrsq3g==        true    0
>> amq.gen-ayBsF3TVUrB/gziaeFd6gg==        true    0
>> amq.gen-hSiCo7cXHduxIWhKm+/6UA==        true    0
>> amq.gen-EzUDC0tIlDbS7lmSgiNxAQ==        true    0
>> amq.gen-dZHzHom4n7Az7yZDdjhuQA==        true    0
>> amq.gen-6Le+Ex6JhIpR32JOCSbPEQ==        true    0
> 
> A chose my words carefully: "auto_delete queues are deleted when the 
> *last consumer disappears*". In other words it's the event of the last 
> consumer disappearing that triggers auto-deletion, not the fact that 
> there are no consumers. An auto-delete queue that has not had any 
> consumers does survive. It has to, since it would have to be deleted 
> straight after creation otherwise. I suspect the queues listed above 
> have never had any consumers.
> 
> 
> Regards,
> 
> Matthias.

Also, when it says "last consumer disappears", it means exactly what is says.  If you use basic.get to pull messages off of those queues one at a time, rather then a basic.subscribe, from my experience, it will not trigger an auto delete.

We were surprised by that and switched from auto-delete to exclusive for the use case we had where we found that.

Scott






More information about the rabbitmq-discuss mailing list