[rabbitmq-discuss] Exclusive queues and mirroring

Jonathan Holland joneholland at gmail.com
Sun Mar 9 00:01:32 GMT 2014


Hi Matthias,

That makes sense, I was thinking for some reason that if queues were not mirrored, a message published by a channel on the other node would not arrive, but I think it would. 

Since our use case requires a temporary queue for each consumer, we don't need mirroring, just a cluster for fault tolerance. A node failure would cause the clients to reconnect and end up on the healthy node with new queues. There would be message loss, but that's ok in our usecase. 

Let me know if there is any holes in my understanding. 

Jon


> On Mar 8, 2014, at 2:12 PM, Matthias Radestock <matthias at rabbitmq.com> wrote:
> 
> Jon,
> 
>> On 08/03/14 00:21, Jonathan Holland wrote:
>> We have a scenario where we want to use queue mirroring in a cluster,
>> but have the queues auto-delete when the last consumer disconnects.
>> 
>> When we have a mirrored policy enabled, and the queue is not exclusive
>> or autodelete, then I see it properly mirroring to a slave node.
>> 
>> When we enable exclusive and autodelete, the queue no longer mirrors.
> 
> What do you mean by "no longer mirrors"?
> 
> You are aware of the semantics of exclusive and auto-delete, right?
> 
> https://www.rabbitmq.com/amqp-0-9-1-reference.html#queue.declare.exclusive
> 
> "Exclusive queues are deleted when that connection [which created the queue] closes"
> 
> https://www.rabbitmq.com/amqp-0-9-1-reference.html#queue.declare.auto-delete
> 
> "the queue is deleted when all consumers have finished using it. The last consumer can be cancelled either explicitly or because its channel is closed"
> 
> Both exclusive and auto-delete are entirely orthogonal to mirroring, though obviously when a node is failing, then all the connections to that node vanish, which in turn triggers the deletion of exclusive queues created by those connections, and  deletion of auto-delete queues where all consumers were connected to that node.
> 
> So usage of these flags in conjunction with mirroring is rarely a sensible combination since the same event that triggers fail-over to a mirrored queue's slave, i.e. the failure of a node, would usually also trigger the deletion of the queue.
> 
> Queues with a TTL (http://www.rabbitmq.com/ttl.html#queue-ttl) are an alternative to auto-delete queues. They can tolerate network and client failures, and, when mirrored, node failures.
> 
> 
> Regards,
> 
> Matthias.


More information about the rabbitmq-discuss mailing list