[rabbitmq-discuss] Durable queue disappears
dmitriy.samovskiy at cohesiveft.com
Wed Sep 10 21:18:03 BST 2008
I came across a strange situation, and can't see what I am doing wrong.
If you run the script below (uses py-amqplib) without a basic_consume call, a queue still
exists in rabbit_amqqueue:stat_all() output after the script exits. However, if you run
the same script with basic_consume call, a queue will exist in stat_all output while the
script is running, but will disappear after the script exits.
This is with rabbitmq-server 1.4.0 on debian. During this test, there are no messages
published to amq.direct with "bar" routing key.
from time import sleep, time
import amqplib.client_0_8 as rabbit
q = "foo%d" % int(time())
conn = rabbit.Connection("127.0.0.1", "guest", "guest")
ch = conn.channel()
ch.queue_bind(q, "amq.direct", "bar")
# if we do not start consumer, queue will remain after conn close - good
# if we do start consumer, queue will be gone - why?
print "stat_all will now have %s queue" % q
print "Ctrl+C to quit"
while True: sleep(100)
except KeyboardInterrupt: pass
print "Now do stat_all - %s is missing if consumer was started" % q
More information about the rabbitmq-discuss