[rabbitmq-discuss] Looking for some clarification on mirrored queue implementation

Matt Pietrek mpietrek at skytap.com
Mon Feb 6 19:27:41 GMT 2012

Here at work, we've been having a spirited debate about the RabbitMQ
descriptions on how HA/mirrored durable queues work. I apologize in advance
if this seems like I'm splitting hairs below, but our team have some very
specific questions regarding the exact wording. While nobody doubts the  end
result of mirroring, the mechanics of *exactly* how this happen are the
subject of debate here. As the designated point person for RabbitMQ in our
company, I'm responsible for driving these questions to closure.

First, I'll mention that we've read and re-read "Highly Available Queues"
and "High Availability in RabbitMQ: solving part of the puzzle" multiple


The crux of the questions come down to these quotes:

"The slaves apply the operations that occur to the master in exactly the
same order as the master and thus maintain the same state. All actions other
than publishes go only to the master, and the master then broadcasts the
effect of the actions to the slaves. Thus clients consuming from a mirrored
queue are in fact consuming from the master."


"messages published to a mirrored-queue are always published directly to the
master and all slaves."

One interpretation of the 2nd quote above ("published directly to...") is
that clients are responsible for writing their messages to the master *as
well as* to all slaves. Perhaps there's some mechanism where at connect
time, the master sends a list of servers to the connecting client, and the
client writes to all instances in the list.

Other people have a different interpretation of how this works, which is
that publishes to *any* broker instances are forwarded by the receiving
slave to the master instance, which in turn pushes the publish requests to
all slaves. (Of course, if the master received the message initially,
there's no need for forwarding.)

Simple question: Which of the above interpretations is correct?

Follow up question: What is the exact flow for a publish that goes to a
slave? Does the slave do anything other than push the message to the master,
which in turn handles the message as if it came to the master in the first
place? Perhaps it writes the message to the local store first, then pushes
it to the master? (Like I said, spirited debate.)

Thanks much for your help,


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20120206/3e6e9dd3/attachment.htm>

More information about the rabbitmq-discuss mailing list