[rabbitmq-discuss] Durable exclusive queues

Brennan Sellner bsellner at seegrid.com
Mon Oct 11 22:55:37 BST 2010

On Mon, 2010-10-11 at 19:00 +0100, Alexandru Scvorţov wrote:
> I don't think exclusive queues are quite what you expect them to be.
> An exclusive queue can only be accessed by the channel that created it.
> A durable queue is one that survives a broker restart.  Since the
> connection and channel will be closed on a broker restart, a durable
> exclusive queue would become completely unaccessible.

Right: I understood the semantics of exclusive queues, but didn't have a
better word to describe what I was looking for. :-)

> What you probably want is exclusive consumers.  If a consumer sets the
> exclusive bit in the basic.consume method, only that consumer is
> allowed to consume from the queue.  Using this, you can ensure that only
> one consumer consumes from any queue at any time.
> I'm not familiar with txAMQP, but have a look at basic.consume.  There
> should (fingers crossed) be an 'exclusive' parameter.

And that did the trick!  I was so focused on the queues, I missed that
part of the consumer spec.  For others' reference, the appropriate
txAMQP invocation is:

  chan.basic_consume ( queue = queueName, exclusive = True)

where chan is the parameter provided to the AMQClient.channelAdded
callback, after opening it.

Thanks, Alex & CyBergRind!


More information about the rabbitmq-discuss mailing list