I am trying to write a camel route that consumes incoming message from a JMS queue and handles them concurrently in different threads. The camel route I have got is like this:
<camel:endpoint id="requestQueue" uri="jms:queue.request" camelContextId="camel"/>
<camel:endpoint id="responseQueue" uri="jms:queue.response" camelContextId="camel"/>
<camel:camelContext id="camel">
<camel:threadPool id="serviceThreadPool" poolSize="10" threadName="workerThread" maxPoolSize="20"/>
<camel:route id="requestServingRoute">
<camel:from ref="requestQueue"/>
<camel:threads executorServiceRef="serviceThreadPool">
<camel:to uri="bean:doSomething"/>
<camel:to ref="responseQueue"/>
</camel:threads>
</camel:route>
</camel:camelContext>
However, what I can observe is that the incoming message is indeed handled by separate threads, but they are handled in a sequential order.
What I tried to achieve is that camel handles each request in the doSomething bean in separate threads for each incoming request.
How can I achieve this?
Thank you very much.