[rabbitmq-discuss] data being fetched from other queues too(that are not named in basicConsume)

Amr Mostafa amr.mostafa at gmail.com
Mon Apr 11 15:02:18 BST 2011

Hi Kamal,

It looks like you are mistaking Channel.basicConsume for Channel.basicGet.
The first (which you are using) is asynchronous and what it does is
subscribe a consumer with the messaging server on a given queue. All
incoming messages to do that queue will be directly sent by the messaging
server to that subscribed consumer. In the QueuingConsumer implementation,
those received messages are held in an internal queue and you fetch them
using nextDelivery.

This model is called subscription-based, another simpler approach is using
Channel.basicGet. I advise you to check this for details:


On Mon, Apr 11, 2011 at 3:19 PM, Kamal <kamal.nandan at gmail.com> wrote:

> Hi,
> I am facing a strange problem while using RabbitMq.
> I have a consumer that creates 3 queues(just for name sake HIGH/MEDIUM/
> LOW priority queues) on the RabbitMQ server and consumes data from the
> 3 queues in this order:
> 5 messages from HIGH
> 3 messages from MEDIUM
> 2 messages from LOW.
> This keeps on happening in round-robin fashion.
> If there is no data available on the respective queue, the data from
> the next queue is fetched.
> I am using "Channel.basicConsume(queueName, ACK, QueueingConsumer)"
> and "QueueingConsumer.nextDelivery(timeout)" to fetch the data.
> What I see here is: I see that the data is fetched from the other
> queues too. i.e. Even though I have passed the queuename as "HIGH",
> then too i see that the data is being fetched from the queue "LOW" or
> "MEDIUM" and vice versa. I am finding this behaviour quite strange.
> Can someone plz help me out with this.
> Following is a snippet of my code.:
> http://pastebin.com/s03dP91z
> Thanks in advance..
> Regards,
> Kamal
> _______________________________________________
> rabbitmq-discuss mailing list
> rabbitmq-discuss at lists.rabbitmq.com
> https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss

Amr Mostafa
Egypt Development Center
Member of NTG
Mobile: +(2012)1700502
Office: +(202)24052355/6 - Ext.: 2005
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20110411/934fca5b/attachment.htm>

More information about the rabbitmq-discuss mailing list