activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bruce Snyder <bruce.sny...@gmail.com>
Subject Re: Race conditions
Date Sun, 08 Nov 2009 19:19:58 GMT
On Sun, Nov 8, 2009 at 6:33 AM, Wais <hackwais@gmail.com> wrote:
>
> Hi,
>
> I've got one machine (x) publish to activemq where there are 2 subscribers
> (y, z). y is a databse that logs all the events as they happen within this
> system, the z is a machine which acts in response to messages published by
> x.
>
> So, I am worried by this scenario.
>
> x publishes to active mq, z reacts and also publishes to activemq. This
> happens very quickly (probably < 1/5th of a millisecond). What I'm afraid
> off is that due to thread switching, the message by z may be picked up by y
> before the message by x. Does activemq guarantee the order of messages in
> this way?

If you need message ordering you can enable it using the
strictOrderDispatchPolicy for a given destination or set of
destinations:

http://activemq.apache.org/total-ordering.html

Bruce
-- 
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: http://bit.ly/2je6cQ
Blog: http://bruceblog.org/
Twitter: http://twitter.com/brucesnyder

Mime
View raw message