[rabbitmq-discuss] autodelete exchanges and queues

Simon MacMullen simon at rabbitmq.com
Wed Oct 5 18:25:56 BST 2011


On 05/10/11 18:04, PADIOU Pierre-Marie (MORPHO) wrote:
> Hello,
>
> I am wondering what is the life cycle of autodelete exchanges and queues.
>
> What if :
>
> 1)Channel A declares an autodelete exchange
>
> 2)Channel B declares the same autodelete exchange (passive=false)
>
> 3)Channel A disconnects
>
> 4)Channel B disconnects
>
> I was under the impression that rabbitmq would delete the exchange
> between step 3) and 4) (which I btw do not find very logical), no matter
> if B was still alive. Is that true? What about queues?
>
> In other words, autodelete = “delete when last declaring-channel leaves”
> OR “delete when first-declaring-channel leaves”?

Hi Pierre-Marie. autodelete and exclusive frequently get confused.

exclusive = delete when declaring *connection* closes. No other 
connection can even access this. Only queues can be exclusive.

autodelete = delete when the *last* downstream thing (i.e. consumers for 
a queue, or queues for an exchange) goes away. Note that this isn't 
bound to channels or connections at all really.

exclusive is more frequently useful than autodelete.

Cheers, Simon

-- 
Simon MacMullen
RabbitMQ, VMware


More information about the rabbitmq-discuss mailing list