[rabbitmq-discuss] Publisher confirms when the unexpected happens
matthias at rabbitmq.com
Sat Jan 12 12:19:14 GMT 2013
On 12/01/13 11:59, Chris Duncan wrote:
> I am publishing persistent messages which get routed via a durable
> direct exchange to a durable queue. The channel that I'm using is in
> confirmation mode. There are no consumers subscribed to the queue.
> What I would like to understand is what happens if my publisher loses
> its AMQP connection and channels after it has sent all of its messages
> but before it can receive any confirmations. I'm testing this in two ways:
> 1. My publisher sends its messages and then exits immediately.
> 2. My publisher sends its messages, closes the connection/channels in a
> controlled manner and then exits.
> No. 2 above always results in all of the messages appearing in the
> target queue. I don't have any issues with this behaviour.
> However, when I perform No. 1 above, I am observing inconsistent
> behaviour. Sometimes all of the messages appear in the target queue, but
> at other times only some of the messages appear. There are always some
> messages in the queue - never zero.
> What I was hoping for was an 'all or nothing' outcome for No. 1 as in
> No. 2. So what I'd like to know is - is the behaviour that I'm seeing
> expected from a RabbitMQ point of view?
That behaviour is perfectly normal and expected. See my reply to your
The fact that you have the channel in confirm mode is irrelevant here,
since you are not actually looking at the confirmations. If you did then
you'd know which message definitely have been received and processed by
the broker. But you still wouldn't have an "all or nothing" guarantee.
Transactions are the closest you can get for that.
More information about the rabbitmq-discuss