[rabbitmq-discuss] are multiple threads per connection ok for java api?

Jim Irrer irrer at umich.edu
Fri Jul 8 16:42:28 BST 2011


Excellent - thanks for the response.

- Jim

Jim Irrer     irrer at umich.edu       (734) 647-4409
University of Michigan Hospital Radiation Oncology
519 W. William St.             Ann Arbor, MI 48103


On Fri, Jul 8, 2011 at 11:16 AM, Michael Klishin <
michael.s.klishin at gmail.com> wrote:

>
>
> 2011/7/8 Jim Irrer <irrer at umich.edu>
>
>> For the Java client API, the RabbitMQ documentation says that
>> a single channel should not be used by more than one thread, but
>> it does not explicitly say anything about connections.
>>
>>
> AMQP assumes that one connection is typically used by more than one
> channel. So
>
>
>> Is it ok to have multiple threads (each with their own channel)
>> sharing the same connection?
>>
>
> if channels are not shared between threads, then yes.
>
>
>> Is there some advantage (performance
>> or otherwise) to using a single connection verses multiple ones?
>>
>
> If all connections use the same credentials and connect to the same
> broker/vhost, then no
> (this should read: in vast majority of cases, no).
>
>
>>  BTW - I'm assuming that each connection corresponds to a
>> socket, and so opening lots of them consumes a somewhat limited
>> system resource.
>>
>
> Long story short, this is true. Each connection has a frame handler that
> opens a new socket.
>  --
> MK
>
> http://github.com/michaelklishin
> http://twitter.com/michaelklishin
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20110708/93a240bd/attachment.htm>


More information about the rabbitmq-discuss mailing list