qpid-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gordon Sim <g...@redhat.com>
Subject Re: Python Client: durability?
Date Wed, 05 Mar 2008 08:30:41 GMT
Carl Trieloff wrote:
> the store is a module that the daemon loads. For M2 which is AMQP 0-8 
> here are notes http://cwiki.apache.org/qpid/getting-started-guide.html

More specifically: http://cwiki.apache.org/qpid/3rd-party-libraries.html

> in terms of python code fragment to set durability for 0-8 I will let 
> someone that know what the best example is comment

Something like the following will work for 0-8:

#make the queue durable:
channel.queue_declare(queue="myqueue", durable=True)

#mark the published message as durable (delivery-mode=2,
#where 2 implies durability):

channel.basic_publish(routing_key="myqueue",
     content=Content("MyMessage", properties={'delivery_mode':2}))

A durable message enqueued on a durable queue will survive even if the 
broker goes down.

(Note, If you create exchanges other than the standard ones - 
amq.direct, amq.topic etc) you can specify durable=true to them also. 
That way the bindings to durable queues will be restored on recovery. 
The standard exchanges are all durable by default.)

Mime
View raw message