[rabbitmq-discuss] Need a design suggestion - Limited Consumer handling

Michael Klishin mklishin at gopivotal.com
Mon Apr 28 11:46:46 BST 2014


On 28 April 2014 at 12:04:26, Subshiri S (subshiri at gmail.com) wrote:
> > There are 100 queues and 10 threads to consume messages from  
> that 100 queue.
> Each thread will be consuming messages from 10 queue each.
> Question 1 : How to dynamically assign the threads to queues ?  

If you know queue names, it’s as easy as splitting a collection in groups of 10.
If you don’t, do it when you have queue names.

> No more than one thread should consume from a queue (to maintain  
> the order of processing the message in the respective queue)  
> Question 2 : When there is a need to increase the consumer threads  
> while the system runs, How it can be done ?.

It depends on your client library. In general, concurrent processing
of messages while preserving order is not trivial and will require consumer
synchronization in the client, one way or another. 

You can specify a custom concurrent pool in some clients, e.g. Java:
http://rabbitmq.com/api-guide.html
--  
MK  

Software Engineer, Pivotal/RabbitMQ


More information about the rabbitmq-discuss mailing list