[rabbitmq-discuss] rabbitmq-c -- multiple exectables receiving same message

Simone Busoli simone.busoli at gmail.com
Thu Jun 30 23:06:18 BST 2011


Hi Lowell,

The second tutorial does not use a topic exchange, but even with a topic
exchange the situation would be the same. The key point here is that your
workers are reading messages from the same queue. The exchange, topic or
anything else, as soon as it has delivered a message to a queue is out of
the game. The queue receives the message because it's bound to the exchange.
Then you have two or more workers reading from the same queue, thereby
receiving each one message in a round-robin fashion.
On Jun 30, 2011 11:29 PM, <Lowell.Boggs at emc.com> wrote:
> I am confused by my experiments with rabbitmq-c.
>
> I was trying to follow the task worker tutorial:
>
> http://www.rabbitmq.com/tutorials/tutorial-two-python.html
>
> Of course, I'm using C interfaces not the python or Java interfaces.
>
> Being a newbie it is probable that I'm doing something wrong, but:
>
> The tutorial implies to me that if I have:
>
> * one exchange+topic
> * two worker executables that read from it
>
> then
>
> * due to round-robin processing, some messages will go to one executable
> * other messages will go to the other
>
> However, I am seeing that both exectuables receive all the messages --
which is not at all what I want.
>
> Is this supposed to work with the default version of rabbitmq-c?
>
> Immediately upon logging into the channel, in the consumers, I am setting
>
> basic_qos(conn, 1, 0, 1, 0);
>
> Also, I am calling basic_consume like this:
>
> amqp_basic_consume(conn,
> 1,
> amqp_cstring_bytes(queuename),
> amqp_empty_bytes,
> 0,
> 0,
> 0,
> amqp_empty_table
> );
>
>
> The exchange that i am using is amq.direct. I have tried an empty string
queue name as well as "hello".
>
> I am calling basic_ack() as soon as I receive the messages in both worker
executables -- well, after I log their reception.
>
> Any ideas?
>
> Thanks,
> Lowell
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20110701/7f6a7ce8/attachment.htm>


More information about the rabbitmq-discuss mailing list