[rabbitmq-discuss] sub-request a message using a message batch

Matthew Sackman matthew at lshift.net
Fri Apr 2 16:45:09 BST 2010


On Fri, Apr 02, 2010 at 10:27:31AM -0500, Jon Brisbin wrote:
> I figured that something like this was going on, but at the time, I didn't know about the QueueingConsumer class. I stumbled across it, though, and now I'm letting the consumer load up a BlockingQueue with responses and my Callable/Runnable waits for incoming messages directly from the queue.

Yes, needless to say, in the 300 or so open items in our issue tracker,
one is to have some documentation which actually recommends using the
QueueingConsumer.

> I suppose the same thing happens if I use nextDelivery(), but without having to declare a separate Queue?

Yes it sounds very much like you've implemented yourself exactly what
QueueingConsumer does.

> I'm still not clear on the relationship between Channels and Threads. Right now, I have a separate Channel for each thread (multiple workers load-balanced by listening to the same queue) and one to receive the messages on (it dispatches to the other workers in the other threads). I don't know if this is "proper", though.

The API guide does talk about this, and yes, you should not share Channels
between multiple threads. http://www.rabbitmq.com/api-guide.html#channel-threads

Matthew




More information about the rabbitmq-discuss mailing list