How to configure the number of concurrent consumers listening on an ActiveMQ Camel endpoint

Solution Verified - Updated -

Environment

  • Camel 2.8

Issue

How to specify the number of concurrent consumers listening on a JMS endpoint in a Camel route

Resolution

To set the number of concurrent consumers on a camel endpoint one can add the concurrentConsumers=X option within the endpoint URI, e.g:


activemq:queue:incomingQueue?concurrentConsumers=15

Using this endpoint in a Java DSL


from(" activemq:queue:incomingQueue?concurrentConsumers=15") .to("bean:mySampleBean")

For more information on what options are available on the Camel JMS endpoints see Camel JMS component documentation. The documentation also outlines alternative approaches to setting the concurrent consumers under the section "Concurrent Consuming".

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.

Comments