activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Torsten Mielke <tors...@fusesource.com>
Subject Re: Ordering of messages with a network of brokers ...
Date Fri, 16 Mar 2012 09:15:52 GMT
Hello Greg,

Both statements are correct. The first link refers to running a single broker instance. In
that case messages will be dispatched in order to all topic consumers and in round-robin fashion
to all queue consumers.

Your second quote refers to the fact that when running broker instances in a broker network
(each node in the network runs a single broker, not a master/slave pair) messages may be trapped
in a broker if that broker goes down and hence potentially cannot be delivered in order (i.e.
if another producer connected to a different broker in the network continues to produce msgs
on the same destination, these msgs will be dispatched). The messages on the crashed broker
can only be delivered whenever that crashed broker is restarted. This could potentially take
some time, depending on how quickly you can recover from that crash. 
One possible solution is to create a broker network with master/slave pairs on each node.
In that case the slave broker will be able to take over after a master broker crash within
a few seconds. As that failover still takes a couple of seconds, you still have the potential
that for that period of time messages may be delivered out of order. 


> or with a network of brokers will the other
> brokers store up the messages from the producer until the failed
> broker recovers, thus preserving the order during delivery?


No, that will not happen. Other brokers will continue to accept and dispatch messages and
hence the order of messages being dispatched may not be preserved. 


Hope this helps.

Torsten Mielke
torsten@fusesource.com
tmielke@blogspot.com

On Mar 15, 2012, at 6:08 PM, Greg Thomas wrote:

> I note at http://activemq.apache.org/how-do-i-preserve-order-of-messages.html
> that is says "ActiveMQ will preserve the order of messages sent by a
> single producer to all consumers on a topic".
> 
> However, at http://activemq.apache.org/clustering.html it says:
> 
> The problem with running lots of stand alone brokers or brokers in a
> network is that messages are owned by a single physical broker at any
> point in time. If that broker goes down, you have to wait for it to be
> restarted before the message can be delivered.
> 
> Now does that mean that the FAQ in the first link only applies to
> non-clustered solutions; or with a network of brokers will the other
> brokers store up the messages from the producer until the failed
> broker recovers, thus preserving the order during delivery?
> 
> Thanks,
> 
> Greg





Mime
View raw message