[rabbitmq-discuss] How to catch RESOURCE_LOCKED exceptions in erlang client

Matthias Radestock matthias at rabbitmq.com
Fri Aug 16 09:50:45 BST 2013


On 16/08/13 09:30, Tim Watson wrote:
> But isn't your second client/consumer just going to be stuck in a
> loop of constantly attempting a basic.consume, failing and then
> retrying again!? That seems like a serious waste of resources, both
> in the client and on the server. Worse still, it simply won't work
> because if the queue is exclusive, when the channel that declared it
> is closed, the queue will be deleted! Your second consumer will never
> be able to establish itself as a consumer. I guess that's probably
> not what you want.

I suspect Mark was thinking of the exclusive consumer feature, i.e. the 
'exclusive' flag on basic.consume 
(http://www.rabbitmq.com/amqp-0-9-1-reference.html#basic.consume.exclusive).

However, the "RESOURCE_LOCKED - cannot obtain exclusive access to locked 
queue 'q1' in vhost '/'" error message from Mark's email does actually 
correspond to an exclusive *queue* access failure, just as you have been 
describing above; the error message for an exclusive consumer violation 
would be "ACCESS_REFUSED - queue ... in exclusive use".

Regards,

Matthias.


More information about the rabbitmq-discuss mailing list