<div dir="ltr"><div dir="ltr"><div dir="ltr">Hi Kamal,<br><br>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.<br>
<br>This model is called subscription-based, another simpler approach is using Channel.basicGet. I advise you to check this for details:<br><br><a href="http://www.rabbitmq.com/api-guide.html" target="_blank">http://www.rabbitmq.com/api-guide.html</a><br>
<br><div class="gmail_quote">On Mon, Apr 11, 2011 at 3:19 PM, Kamal <span dir="ltr"><<a href="mailto:kamal.nandan@gmail.com" target="_blank">kamal.nandan@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Hi,<br>
<br>
I am facing a strange problem while using RabbitMq.<br>
<br>
I have a consumer that creates 3 queues(just for name sake HIGH/MEDIUM/<br>
LOW priority queues) on the RabbitMQ server and consumes data from the<br>
3 queues in this order:<br>
5 messages from HIGH<br>
3 messages from MEDIUM<br>
2 messages from LOW.<br>
<br>
This keeps on happening in round-robin fashion.<br>
If there is no data available on the respective queue, the data from<br>
the next queue is fetched.<br>
<br>
I am using "Channel.basicConsume(queueName, ACK, QueueingConsumer)"<br>
and "QueueingConsumer.nextDelivery(timeout)" to fetch the data.<br>
<br>
What I see here is: I see that the data is fetched from the other<br>
queues too. i.e. Even though I have passed the queuename as "HIGH",<br>
then too i see that the data is being fetched from the queue "LOW" or<br>
"MEDIUM" and vice versa. I am finding this behaviour quite strange.<br>
Can someone plz help me out with this.<br>
<br>
Following is a snippet of my code.:<br>
<a href="http://pastebin.com/s03dP91z" target="_blank">http://pastebin.com/s03dP91z</a><br>
<br>
Thanks in advance..<br>
<br>
Regards,<br>
<font color="#888888">Kamal<br>
_______________________________________________<br>
rabbitmq-discuss mailing list<br>
<a href="mailto:rabbitmq-discuss@lists.rabbitmq.com" target="_blank">rabbitmq-discuss@lists.rabbitmq.com</a><br>
<a href="https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss" target="_blank">https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss</a><br>
</font></blockquote></div><br></div></div><br clear="all"><br>-- <br>Amr Mostafa<br>Egypt Development Center<br>Member of NTG<br>Mobile: +(2012)1700502<br>Office: +(202)24052355/6 - Ext.: 2005<br>
</div>