[rabbitmq-discuss] Process N messages / VM concurrently
opendev at gmail.com
Mon Jul 7 12:29:25 BST 2008
2008/7/5 Ben Hood <0x6e6562 at gmail.com>:
>> I wasn't aware of that - this complicates things obviously. I'll come
>> back to the list as soon as things are running (using Spring).
> I don't see how this complicates things - after all, you have a simple
> 1:1 mapping between a thread and a channel. Such is the intention of
That was a misunderstanding. I wasn't aware that a channel has state -
this complicates things.
> A crude way of mapping a channel to a thread (in Java) is to stick the
> channel reference in the thread local and make sure that you perform
> any synchronous operations eagerly in a single threaded fashion or
> lazily in a thread safe fashion. I'm sure you can think of more
> elegant ways to use a channel in a single threaded fashion.
Not so crude actually. I think I'll use a ThreadLocal channel instance.
More information about the rabbitmq-discuss