[rabbitmq-discuss] use one channel for many consumers/producers
Mohsen Lotfizad
mtlotfizad at gmail.com
Mon Nov 12 16:15:33 GMT 2012
Hi
1. *could I use a channel for many (about 20) producers?*
2. *could I use a channel for many (about 20) consumers?*
3. *How cloud I increase the socket descriptors from 829 to 2000? (in
RHEL 5) *
the problem raise from limitations of socket descriptors. I have about 50
weather evaluation station (there are actually a PC with some stuff) and
each station connects to 20 queue. and a server (a *HP* ProLiant *DL380*)
that runs the rabbitMQ server. there is also about 40 consumer (for each
queue there is 2 consumer). at start I create one channel for every
connection to every queue. soon I face socket descriptors limitations (it's
actually 829). So I share the channel among producers:
//in each weather evaluation station this code is running
factory = new ConnectionFactory();
factory.setUri(toURI);
connection = factory.newConnection();
channel = connection.createChannel();
for(int i =0; i< 20; i++)
WeatherProducer basicProducer = new WeatherProducer(i , channel);
and in consumers I do the same.
//in each weather evaluation station this code is running
factory = new ConnectionFactory();
factory.setUri(toURI);
connection = factory.newConnection();
channel = connection.createChannel();
for(int i =0; i< 20; i++)
for(int j =0; j< 20; i++)
WeatherConsumer basicConsumer = new WeatherConsumer (j , channel);
the problem is that in my WeatherConsumer when I try to read a message
(with nextDelivery() ) the thread go to wait! So I guess the problems raise
from using a channel for many consumers.
thanks for your attention.
--
Sincerely
ML
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20121112/1f4279f5/attachment.htm>
More information about the rabbitmq-discuss
mailing list