[rabbitmq-discuss] Making sure a message gets to every consumer
Marek Majkowski
majek04 at gmail.com
Tue Jan 25 18:35:28 GMT 2011
On Tue, Jan 25, 2011 at 18:22, Dan Tenenbaum <dtenenba at fhcrc.org> wrote:
>> If you haven't done so already, I recommend reading
>> http://www.rabbitmq.com/tutorial-three-python.html
>>
>
> I have read this, thanks.
> Here is an attempt that uses two fanout exchanges and two queues, one bound
> to each exchange with '#'. You would think (well, I would think) that any
> message sent to either of these fanout exchanges is going to go to every
> consumer of every queue bound to the appropriate exchange.
If N messages go to the queue, exactly N messages will go out, no
matter how many consumers are hanging on that queue.
If N messages go to the exchange, any number may go out, depending on bindings.
Exchanges - broadcast.
Queues - buffering.
> However, what happens in practice is only one receiver at a time gets a
> message.
You need to have exactly as many queues as many copies of the message
you'd like to receive.
Once again: a message distributed to queue will not be copied to
multiple consumers. It will
be distributed to a single consumer only.
Cheers,
Marek
More information about the rabbitmq-discuss
mailing list