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

Lowell.Boggs at emc.com Lowell.Boggs at emc.com
Fri Jul 1 15:02:21 BST 2011


Also,
The one piece of the tutorial I have not actually duplicated in my experiments is the use of the durable flag on queue creation and the use use of persistent in the message creation.  Would that have anything to do with the round robin distribution of messages to queues?

Thanks,
   Lowell

________________________________
From: Simone Busoli [mailto:simone.busoli at gmail.com]
Sent: Thursday, June 30, 2011 5:06 PM
To: Boggs Jr., Lowell
Cc: rabbitmq-discuss at lists.rabbitmq.com
Subject: Re: [rabbitmq-discuss] rabbitmq-c -- multiple exectables receiving same message


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<mailto: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/da7ed72c/attachment.htm>


More information about the rabbitmq-discuss mailing list