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

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

Search Discussions

  • Jhiemer at Jan 9, 2012 at 12:58 pm
    Hi,
    I finally solved my issue with the help of Spring. In Spring AMQP
    there is an option for the definition of consumers being started when
    creating a SimpleMessageListenerContainer. A successful configuration
    looks like this:

    public SimpleMessageListenerContainer compositionListenerContainer() {
    SimpleMessageListenerContainer container = new
    SimpleMessageListenerContainer(connectionFactory());
    container.setQueues(compositionQueue());
    container.setMessageListener(compositionMessageListenerAdapter());
    container.setAcknowledgeMode(AcknowledgeMode.MANUAL);
    container.setPrefetchCount(prefetchCount);
    container.setErrorHandler(errorHandler());
    container.setConcurrentConsumers(concurrentConsumers);
    return container;
    }

    Have a nice day.
    On Jan 9, 12:25?pm, jhiemer wrote:
    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

    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
    _______________________________________________
    rabbitmq-discuss mailing list
    rabbitmq-disc... at lists.rabbitmq.comhttps://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouprabbitmq-discuss @
categoriesrabbitmq
postedJan 9, '12 at 11:25a
activeJan 9, '12 at 12:58p
posts2
users1
websiterabbitmq.com
irc#rabbitmq

1 user in discussion

Jhiemer: 2 posts

People

Translate

site design / logo © 2022 Grokbase