[rabbitmq-discuss] amqp_channel_open issue

Jim Irrer irrer at umich.edu
Thu Feb 18 17:55:48 GMT 2010


So the C client is different from the Java client implementation, which says
that multiple
threads can share a connection, but not a channel:

http://www.rabbitmq.com/releases/rabbitmq-java-client/v1.6.0/rabbitmq-java-client-javadoc-1.6.0/com/rabbitmq/client/Channel.html

While a Channel can be used by multiple threads, it's important to ensure
that only one thread executes a command at once. Concurrent execution of
commands will likely cause an UnexpectedFrameError to be thrown.

Is my understanding correct?

If I have a multi-threaded Java client that needs many channels, then it is
ok (and more efficient)
to have one connection and construct many channels from it?

Thanks,

- 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 Thu, Feb 18, 2010 at 1:05 AM, Tony Garnock-Jones <tonyg at lshift.net>wrote:

> Hi Ragavendra,
>
> raghu a wrote:
> > As per my code each thread is using different channel.
> > May I get any  multi threaded C client samples?
>
> I'm sorry to say that multithreaded use of librabbitmq will not work
> without quite a bit of effort. It is designed for event-based systems,
> not multi-threaded systems. Its internal architecture is quite different
> from our other client libraries, where sharing connections between
> threads is just fine.
>
> With that said, however, you *can* use librabbitmq with a connection per
> thread; just don't try to share a connection or its channels between
> threads at the moment.
>
> Regards,
>   Tony
>
>
> _______________________________________________
> rabbitmq-discuss mailing list
> rabbitmq-discuss at lists.rabbitmq.com
> http://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20100218/3a9be8a5/attachment.htm 


More information about the rabbitmq-discuss mailing list