[rabbitmq-discuss] Concurrently execution of jobs - Spring AMQP with RabbitMQ

jhiemer jvhiemer at googlemail.com
Mon Jan 9 11:25:55 GMT 2012


Hi,
I have a basic question regarding the design of an application. The
scenario is as follows. A frontend sends job message to two different
queues (respectively routingKeys). The following shows the
configuration of the queues.

amqp.schedule.routingKeyName=service.schedule
amqp.schedule.routingKey=service.schedule
amqp.schedule.queue=service.schedule
amqp.schedule.max=10

amqp.compose.routingKeyName=service.compose
amqp.compose.routingKey=service.compose
amqp.compose.queue=service.compose
amqp.compose.max=2

While scheduling does not take that much time, compose jobs may take
between 1 and 10 minutes. As you can see I can run 10 schedule jobs
concurrently, while I can only run 2 compose jobs concurrently. I am
using Spring AMQP with RabbitMQ.

To limit this, do I need to run for compose 2 consumers, and for
schedule 10?

P.S. In Spring AMQP there is ChannelAwareMessageListener, which fires
asynchronous the onMessage() method, whenever a message arrives,
opening a thread for each message. Would that be the other way to go?
What would I need to take care of in this case? What I was thinking of
was two Consumers (Compose, Schedule) with prefetchCount set to 2
(Compose) or 10 (Schedule) to limit the concurrent execution of tasks?

I would be glad if anyone could help me out. I am bit stuck at the
moment. :-(

Regards


More information about the rabbitmq-discuss mailing list