[rabbitmq-discuss] Transactions & Routing

Matthias Radestock matthias at rabbitmq.com
Wed Apr 6 23:01:49 BST 2011


Jason J. W. Williams wrote:
> The desire is generally for durable messages to survive a broker
> crash.

Only if they need to be delivered to somebody, eventually.

> Since publishes return no status, that leaves ambiguity as to whether
> a durable message has been persisted to disk should  a broker crash
> occur directly after publishing. My understanding with transactions
> were that they were how to confirm that Rabbit had the message in
> custody safely. Should a broker crash occur before the transaction
> returned a success, you knew you should republish. However, if the
> crash occurred after the transaction returned success then you could
> trust that Rabbit had persisted it to disk and move on to the next
> message.

tx.commit-ok indicates that rabbit has successfully processed the 
messages. If there is no queue for the messages to go to then 
"sucessfully processed" means dropping the message.

> Since I now understand that inside of Rabbit and exchange is not
> router but simply a routing table, the fact that the exchange is
> durable makes no guarantees a durable message in the middle of being
> routed will survive a broker crash. The only place it will be
> persisted is the queue, so the guarantee I think people are looking
> for with a transaction is that the durable message has made it far
> enough into Rabbit's custody to be persisted to disk.

Transactions and the new 'confirms' let the producer know that the 
broker has take responsibility for the message. It is perfectly ok for a 
message not to go anywhere during routing and thus be dropped. Indeed, 
leaving transactions and confirms aside, what is supposed to happen to 
persistent messages which do not get routed to any queues? Should the 
broker hold on to them in the hope that some queue will turn up eventually?



More information about the rabbitmq-discuss mailing list