When I am consuming from a JMS topic and set the concurrentConsumers property
to 5, then the same message is replicated five times. That is so, because at
the time the topic sees 5 subscribers and sends the same message to all
subscribers. This is a behaviour which I don't want, because I want to have
competing consumers, i.e. have messages consumed concurrently by multiple
threads instead of sending the same message to 5 threads.
<route>
<from
uri="jms:topic:LoggingTopic?concurrentConsumers=5"/>
<to uri="bean:msgParser"/>
<to uri="direct:foo"/>
</route>
To achieve what I want I guess I should have a JMS queue which will consume
messages from the topic, and then set concurrentConsumers on the queue.
However, in that case I would have multiple routes, and to configure
multiple routes in Spring I need to use the "direct" keyword, which
unfortunately does not allow concurrentConsumers.
<route>
<from uri="jms:topic:LoggingTopic"/>
<to uri="jms:queue:LoggingQueue"/>
</route>
<route>
<from
uri="jms:queue:LoggingQueue?concurrentConsumers=5"/>
<to uri = uri="bean:msgParser"/>
</route>
This one will not work. Any advice on how to achieve what I want ?
--
View this message in context:
http://www.nabble.com/JMS-Topic-multiple-consumers-tp20263635s22882p20263635.html
Sent from the Camel - Users mailing list archive at Nabble.com.