[rabbitmq-discuss] is anybody using 'immediate' publish?

Matthias Radestock matthias at rabbitmq.com
Fri Sep 14 13:48:12 BST 2012


Richard,

On 14/09/12 13:34, Randall Richard wrote:
> Admittedly, I'm not fully aware of exactly how it works.  It would be
> helpful to have a better understanding of the semantics.  Can you
> explain what the publisher is notified of (if anything?) when there are
> 10 queues bound to an exchange named HighPriority, a message with
> immediate flag true is published to HighPriority, and 7 out of the 10
> queues have the message consumed immediately.

No notification is sent to the publisher in that case. A basic.return is 
only sent if *no* queues were able to send the message to a consumer 
immediately.

Here are a few more warts about 'immediate':

- while a message might get sent out to a consumer straight away, there 
is of course no guarantee that such a message will reach the consumer, 
get processed and ack'ed. If any of these steps go wrong the message 
will end up in the queue (unless the consuming happened with no-ack, in 
which case it is simply lost), even though supposedly it was delivered 
immediately.

- a queue can have a consumer and yet 'immediate' delivery may fail (and 
a basic.return issued) because:
a) the consumer isn't quick enough and a backlog of messages has built up,
b) the consumer has configured a 'basic.qos' prefetch count and that the 
limit has been reached

- the interaction with transactions is not at all obvious. This does 
apply to 'mandatory' too though. See 
http://www.rabbitmq.com/semantics.html#tx

Regards,

Matthias.


More information about the rabbitmq-discuss mailing list