[rabbitmq-discuss] Durable queue disappears
0x6e6562 at gmail.com
Wed Sep 10 23:03:29 BST 2008
On Wed, Sep 10, 2008 at 9:18 PM, Dmitriy Samovskiy
<dmitriy.samovskiy at cohesiveft.com> wrote:
> Hi all,
> I came across a strange situation, and can't see what I am doing wrong.
It seems that the auto_delete flag overrides the durable flag, which I
guess is a permissible interpretation of the spec :-(
If you change your code when you declare the queue to the following:
ch.queue_declare(queue=q, auto_delete=False, durable=True)
it will behave as you expect.
Now why is that so?
I can't give you a definitive answer off the cuff, but my initial
thought is the way the spec has been construed at this point.
Refer to the definition of auto-delete:
"If set, the queue is deleted when all consumers have finished using
it. Last consumer can be cancelled
either explicitly or because its channel is closed. If there was no
consumer ever on the queue, it won't be deleted."
So if you give auto-delete precedence over durable, this would explain
Stay tuned for a more authoritative answer.
More information about the rabbitmq-discuss