Hello,
I have a problem with concurrently sending messages to InOut jms destination
and processing replies using Camel 2.6.0. I cannot upgrade because of java
1.5. As I undestand, in such case there is only 1 consumer listening for the
replies. I tried using thread dsl, but it didn't help, probably because
there is still only 1 DefaultMessageListenerContainer which listens for the
replies sinchronously and thread dsl creates threads only for processing
those replies afterwards, am I right?
My route:
<camel:route id="esbDirectRoute">
<camel:from uri="direct:esbRoute"/>
<camel:setExchangePattern pattern="InOut" />
<camel:to uri="log:beforeSendingToEsb"/>
<camel:to
uri="jmsIBM:queue:REQ_QUEUE?exchangePattern=InOut&timeToLive=60000&requestTimeout=60000&receiveTimeout=100&concurrentConsumers=20&maxConcurrentConsumers=20"
/>
<camel:threads poolSize="20" maxPoolSize="20"
threadName="esb-pool-thread">
<camel:to uri="log:afterSendingToEsb"/>
</camel:threads>
</camel:route>
There are multiple threads calling this route. When testing with only 1
working thread the time between 2 log statemments is 1-2 s (jms provider
system response time). When there are many threads like 10-20 - time between
log statements increases up to 15 s. Here is log showing the start of this
test:
2014-08-27 10:26:22 INFO beforeSendingToEsb
2014-08-27 10:26:22 INFO beforeSendingToEsb
2014-08-27 10:26:23 INFO beforeSendingToEsb
2014-08-27 10:26:23 INFO beforeSendingToEsb
2014-08-27 10:26:23 INFO beforeSendingToEsb
2014-08-27 10:26:23 INFO beforeSendingToEsb
2014-08-27 10:26:23 INFO beforeSendingToEsb
2014-08-27 10:26:23 INFO beforeSendingToEsb
2014-08-27 10:26:23 INFO beforeSendingToEsb
2014-08-27 10:26:23 INFO beforeSendingToEsb
2014-08-27 10:26:24 INFO afterSendingToEsb
2014-08-27 10:26:24 INFO beforeSendingToEsb
2014-08-27 10:26:25 INFO afterSendingToEsb
2014-08-27 10:26:26 INFO beforeSendingToEsb
2014-08-27 10:26:26 INFO afterSendingToEsb
2014-08-27 10:26:27 INFO beforeSendingToEsb
2014-08-27 10:26:28 INFO afterSendingToEsb
2014-08-27 10:26:28 INFO beforeSendingToEsb
...
Is there any way to use concurrent response listener with Camel 1.6.0? Any
way to control how Camel creates
org.springframework.jms.listener.DefaultMessageListenerContainer or
org.springframework.jms.listener.SimpleMessageListenerContainer in this
case?
Excerpt from camel jms docs:
"Camel will automatic setup a consumer which listen on the reply queue, so
you should not do anything.
This consumer is a Spring DefaultMessageListenerContainer which listen for
replies. However it's fixed to 1 concurrent consumer.
That means replies will be processed in sequence as there are only 1 thread
to process the replies. If you want to process replies faster, then we need
to use concurrency. But not using the concurrentConsumer option. We should
use the threads from the Camel DSL instead"
Seems that this issue is addressed in Camel 2.10.3:
"Allows to process reply messages concurrently using concurrent message
listeners in use. You can specify a range using the concurrentConsumers and
maxConcurrentConsumers options. Notice: That using Shared reply queues may
not work as well with concurrent listeners, so use this option with care."
Thank you,
Igor
--
View this message in context:
http://camel.465427.n5.nabble.com/Request-reply-concurrency-with-jms-in-older-Camel-versions-tp5755769.html
Sent from the Camel - Users mailing list archive at Nabble.com.