1
votes

I am working with apache camel and could use some help with something that i can not figure out. I would like to have multipule listeners on a single JMS queue.

I have a the following config for me camel context

<route id="customerDataRoute" autoStartup="false">
<from uri="activemq:customer.data"/>
<to uri="dataListener"/>
<choice>
...

I would like to have multipule listeners on the customer.data queue , but i am not sure if i set up this correctly or if it is just a config option that i can not nail down. I can start up an instance but only get the one listener.

Any help is greatly appricated!! thanks!

1

1 Answers

2
votes

You've got a couple of choices that I can think of:

  • Define several routes all listening to the same queue. This is good if you want different listeners doing different things for some reason.
  • A more normal way would to define concurrentConsumers to be something more than one. See http://camel.apache.org/competing-consumers.html

In this case you'll have one dataListener being called from multiple threads so you'll have to make sure that its thread safe.