[rabbitmq-discuss] why isn't my queue durable? (python client)

Tony Garnock-Jones tonyg at lshift.net
Thu Apr 30 17:18:29 BST 2009


Brian Whitman wrote:
> I declare the queue and exchange with durable=True. I add a bunch of
> messages and issue a /etc/init.d/rabbitmq-server restart. On restart the
> queue I created has 0 messages.

In AMQP, there are two concepts relating to sorts of permanence:

 - durability: queues and exchanges that survive restarts
 - persistence: *messages* that survive restarts

To get your messages to stick around after a restart, you must both

 - arrange for them to land in a durable queue, AND
 - publish them with delivery-mode set to 2 (meaning persistent)
   in the content header for the basic.publish

I'm not sure of the precise arguments to use with the python client, but
I'm sure they exist :-) (having just glanced at the demos, it looks like
the delivery_mode keyword to the Message() constructor is what you want.)

Regards,
  Tony
-- 
 [][][] Tony Garnock-Jones     | Mob: +44 (0)7905 974 211
   [][] LShift Ltd             | Tel: +44 (0)20 7729 7060
 []  [] http://www.lshift.net/ | Email: tonyg at lshift.net




More information about the rabbitmq-discuss mailing list