Hello, I'm looking for information about using one connection for many channels. In the pika FAQ there is an information:
Pika does not have any notion of threading in the code. If you want to use Pika with threading, make sure you have a
Pika connection per thread, created in that thread. It is not safe to share one Pika connection across threads.
but
in Pivotal RabbitMQ docs there is infomration:
Some applications need multiple connections to an AMQP broker. However, it is undesirable to keep many TCP connections open at the same time because doing so consumes system resources and makes it more difficult to configure firewalls. AMQP 0-9-1 connections are multiplexed with channels that can be thought of as "lightweight connections that share a single TCP connection".
For applications that use multiple threads/processes for processing, it is very common to open a new channel per thread/process and not share channels between them.
Communication on a particular channel is completely separate from communication on another channel, therefore every AMQP method also carries a channel number that clients use to figure out which channel the method is for (and thus, which event handler needs to be invoked, for example).
for me, the most important is stability for my app, I will make a hundreds of channels in new threads a give them connection in constructor. So question is, Is this safe ?