activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bruce Snyder <>
Subject Re: Queue message order
Date Wed, 29 Apr 2009 00:00:17 GMT
On Wed, Apr 29, 2009 at 12:15 AM, Roger Hoover <> wrote:
> Hi,
> Are queued messages supposed to be delivered in order?  I have a simple
> STOMP Perl script below that shows messages delivered out of order.  I've
> run it against AMQ 4.1.1 and 5.2.0 in with both persistent and
> non-persistent messages.  Note from the message ids and timestamps that the
> newer message is delivered first.
> Is there a way to force message delivery order? I don't think selectors
> allow for ordering, right? Our application doesn't particularly depend on
> message order but this behavior is causing my unit tests to fail every third
> time they are run.  :(
> This also seems problematic for STOMP clients using "client" ack mode.
> Since newer messages are delivered first, ack'ing the newer message will
> implicitly ack the older message which has not even been delivered yet.

Ordering of message dispatch doesn't take place by default but it's
easy to achieve. You just need to configure it in the
conf/activemq.xml file using the strict order dispatch policy AKA
total ordering:

perl -e 'print unpack("u30","D0G)U8V4\@4VYY9&5R\"F)R=6-E+G-N>61E<D\!G;6%I;\"YC;VT*"

ActiveMQ in Action:

View raw message