[rabbitmq-discuss] fanout exchange that does not keep messages
matthias at lshift.net
Mon Jul 20 17:20:02 BST 2009
Holger Hoffstätte wrote:
> Brian Whitman wrote:
>> I am concerned about this because over the weekend the broker crashed
>> (not sure why yet, but I assume it had something to do with probably
>> ~50m messages sitting in the exchange.) How can I have messages be
>> completely transient?
> This is done with the "immediate" flag for a message; if there is no
> recipient, the message will be dropped.
Actually, generally a better solution to the problem is to ensure that
the queues do not outlive the consumers - by either marking them
exclusive (if you only have one consumer per queue) or auto-delete.
That way messages do really get dropped silently when there are no
consumers. By contrast, when setting 'immediate' the server will send a
basic.return to the producer.
And buffering can still take place to deal with temporarily
backlogged/slow consumers. By contrast, with 'immediate' the messages
will get dropped when the consumers are busy (not just when they are not
More information about the rabbitmq-discuss