On Thu, Feb 25, 2010 at 8:15 PM, jerdavis <[email protected]> wrote: > > > What total order guarantees does qpid provide? > > Assuming a Queue with 1 Producer, and 1 Consumer, are there any cases where > I can have a consumer pre-fetch some number of messages, then crash, then > have another consumer start up and have the message stream be out of order? > If so are there any protections against that?
Under normal circumstances, for a single producer and consumer pair on a queue, we do guarantee the ordering. However if a consumer crashes (while some messages are in it's prefetch buffer) and somehow the tcp connection remains intact, and then if the client reconnects quickly enough (before the broker realizes the old connection is dead) then the messages that were not acked will be delivered after to the new consumer only after the broker realizes the old consumer was dead. However any messages redelivered are marked with the redelivery flag. > I have seen some brokers define an "Exclusive Consumer" such that only one > consumer is allowed to consume from a queue at a time. Any messages that are > "in doubt" buffered on a consumer when it crashes are automatically > recovered once a new "Exclusive Consumer" connects up, and the total > ordering is preserved. I see there is an Exclusive Consumer in AMQP, does it > provide this functionality? If you use an exclusive subscription on a queue, then the broker will only release the lock, if the current session that owns the lock is destroyed. Hence any messages that were transferred but were not acked will be put on to the queue before the other consumer is allowed, preserving the ordering. > Thanks, > -JD > > > > > -- > View this message in context: > http://n2.nabble.com/Total-Ordering-Guarantee-tp4636556p4636556.html > Sent from the Apache Qpid users mailing list archive at Nabble.com. > > --------------------------------------------------------------------- > Apache Qpid - AMQP Messaging Implementation > Project: http://qpid.apache.org > Use/Interact: mailto:[email protected] > > -- Regards, Rajith Attapattu Red Hat http://rajith.2rlabs.com/ --------------------------------------------------------------------- Apache Qpid - AMQP Messaging Implementation Project: http://qpid.apache.org Use/Interact: mailto:[email protected]
