On 10/03/2008, Brent Villalobos <[EMAIL PROTECTED]> wrote: > I have tried setting "delivery mode" to 2 for a Content object and also > setting up my exchange and queue to "durable=True". Right now I am > using the default persistence configuration (aka: "in-memory", not > Berkeley DB). Perhaps I don't understand the persistence model, but it > seems to me that all the qpid exchange/queue/message data would be > erased when the broker quits since it was all in memory, not written to > disk. Will persistence only work when I use something like Berkeley DB? > > > Here was my test (correct me if I'm doing something wrong): > 1. Launch the QPID Java broker > 2. Setup and bind a direct exchange and queue with durable=True. > 3. Have a producer script create a Content object with the "delivery > mode" property set to 2. > 4. Send the message to the exchange using a "basic_publish". There is > now one unconsumed message on the queue. > 5. Kill the broker with a linux "kill" command to simulate some sort of > system failure. > 6. Restart the broker > 7. Produce another message, there should now be two messages in the > queue. However, in my test I'm only seeing one message. >
That is correct, the Berkeley DB is required for Java M2 persistent messaging as we currently do not have an Apache licensed persistent store. This wiki page : http://cwiki.apache.org/qpid/3rd-party-libraries.html contains details about getting the Berkeley DB module working with the Java broker. I must admit though this page doesn't appear to have been updated for over a year and while things haven't really changed in the store over that time it may not work. I'm just heading home just now but let me take a look at that page and ensure the details are correct for M2. Regards Martin > Martin Ritchie wrote: > > On 05/03/2008, Gordon Sim <[EMAIL PROTECTED]> wrote: > > > >> 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})) > >> > > > > IIRC on M2 the delivery mode property is 'delivery mode' note the lack of > '_'. > > > > > >> 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.) > >> > >> > > > > > > > -- Martin Ritchie
