[rabbitmq-discuss] Should multithreaded application use single or multi channels

Michael Klishin mklishin at gopivotal.com
Sun Mar 9 16:38:49 GMT 2014


On 9 Mar 2014, at 20:34, rails <stammailbox at gmail.com> wrote:

> And I understand that instead of opening multiple connection (expensive)
> it is better to open multiple channels.

This is correct.

> But why not use a single channel to all threads?
> What are the benefits of using multiple channels over a single channel?

Because it is not safe to do so, in particular when you publish messages.
You will get incorrect frame interleaving when publishing from multiple threads
on a shared channel.

MK

Software Engineer, Pivotal/RabbitMQ




More information about the rabbitmq-discuss mailing list