[rabbitmq-discuss] Ordering of messages from a fanout exchange

James Pettit james.l.pettit at gmail.com
Tue Mar 16 16:46:22 GMT 2010


I'm trying to get high availability with live failover. Both nodes would be
bound to the same fanout exchange, and keep synchronized by the fact that
message come to each in the same order. I do realize now why this is
impossible - the same virtual exchange might be multiple physical machines,
and if order were required, these would have to communicate to each other
before sending any message, a terrible toll for performance. I believe the
correct way to do this is to have one of my live nodes be the designated
master, and the master can send the ordering of events to all secondary
nodes (to maintain state in sync). The secondary nodes could then determine
when the master is down and one of them can take up the baton, as it were.
In this case, all that's required is the ordering on messages from the same
channel (the master). Anything wrong with this scenario?
- James

On Tue, Mar 16, 2010 at 3:36 AM, Matthew Sackman <matthew at lshift.net> wrote:

> Hi James,
>
> On Mon, Mar 15, 2010 at 06:55:13PM -0700, James Pettit wrote:
> > Is it possible to have a fanout exchange ensure that it routes messages
> to
> > each queue bound to it in the same order? For example, if Message A and
> > Message B are sent to Queue 1 in the order A < B, they will be sent to
> Queue
> > 2 (and all others) in the order A < B? I have a specific example where
> two
> > consumers are getting the correct messages, but in a different order.
>
> If A and B come from the same channel then yes, their order will be
> preserved. If they come from different channels then all bets are off,
> and there is no knob to turn here - this is just the nature of AMQP I'm
> afraid. If you can give us some more details about the type of problem
> you're trying to solve we may be able to suggest some solutions.
>
> Matthew
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20100316/b54a4dd6/attachment.htm 


More information about the rabbitmq-discuss mailing list