[rabbitmq-discuss] basicGet returns null when there are still messages in a queue

Kevin Conaway kevin.conaway at gmail.com
Wed Apr 15 16:36:23 BST 2009

I have a program that polls every X seconds and tries to process N
messages.  For some reason, basicGet() will return null even if there are
messages still in the queue.

For example:

- I send 100 messages to a queue
- I have a Thread that polls every 3 seconds and processes 30 messages at a

Doing so will result in processing 30 messages, 30 messages, 7 messages and
then leaving 3 messages in the queue.  I can't figure out why those 3
messages don't get processed.  If I rerun my sample program, the last three
messages are processed.

Attached is my sample code using the Java client library

Thank you

Kevin Conaway
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20090415/a343a36f/attachment.htm 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: RabbitMqTest.java
Type: application/octet-stream
Size: 3185 bytes
Desc: not available
Url : http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20090415/a343a36f/attachment.obj 

More information about the rabbitmq-discuss mailing list