[rabbitmq-discuss] Using the same channel for producer and consumer.

Praveen M lefthandmagic at gmail.com
Sat Sep 10 00:35:40 BST 2011


Hi,

I saw a weird behavior when trying to use the same channel for my consumer
and producer in a test.

*Test*

1) The test creates a queue
2) It registers a consumer using basicConsume
3) It enqueues about 500 messages
4) Waits untill all the messages are consumed.

When i run the above test ~ the consumer doesn't get all the 500
messages..It stops somewhere halfway...
I tried repeating the test, it always stopped at some point before
consumption of all messages...somewhere over the halfway mark.

I was wondering if it was something to do with me using the same channel to
produce and consume, and tried switching the producer to use a different
channel,
and boy it started working right - all 500 messages got consumed.

I was wondering if someone could explain this behavior. I'm using the java
client and the latest 2.6.0 build of the server.

*Why was i trying to use the same channel for producer and consumer?*

It wasn't intentional...i just bumped into this issue by a happy mistake.


Thanks for your help.
-- 
-Praveen
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20110909/181f326e/attachment.htm>


More information about the rabbitmq-discuss mailing list