I am new to RabbitMq and I need to develop an application that will have something like 30 to 50 concurrent clients. Each client will send commands to my server. The server applicaton, a .NET C# application, will start a new thread to execute each command.
I would like to know if you consider a good practice in using AMQP Connections and Channels:
· 1 Connection per application or 1 Connection per Client;
· 1 Channel per Exchange/Queue and/or Thread. If the application has more than one thread each one must create a new channel using the same application/client connection.
· Some people advise to create a Channel Pools, is it a good practice.
What do you think about it ???
In general, it is better to create a single connection and as many channels as you need (rather than many connections with a single channel each).
Thanks Simone,
That’s what I presumed to be the best solution. One connection opened when the receiver starts and for each thread that will execute a command create a channel so that the thread can send the response to the respose queue.
Thank you very much
For the numbers you're talking about, 1 connection per application is
not going to be an issue. The IPC et al to do 1 connection per client is
likely going to be quite painful to do, so I'd not recommend that.
> * 1 Channel per Exchange/Queue and/or Thread. If the application
> has more than one thread each one must create a new channel using the
> same application/client connection.
1 Channel per Thread is definitely best practise. Certainly in the Java
client it's unwise to share channels between threads, and I suspect the
same is true of the .net client.
> * Some people advise to create a Channel Pools, is it a good
> practice.
Generally no, because channels are stateful, and thus it's difficult to
ensure that a random channel grabbed from a pool is indeed in the
expected state. This is especially true of things like publisher
confirms, transactions etc.
Matthew
_______________________________________________
rabbitmq-discuss mailing list
rabbitmq...@lists.rabbitmq.com
https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss