You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Siva B <kb...@yahoo.com.sg> on 2013/06/04 17:00:46 UTC

Setting a requestTimeout for a shared/Exclusive reply does not take effect for multiple concurrent users

Setting requestTimeout of 1 second and receiveTimeout of 250 milliseconds
timing out right after 1 second for a single request if there is no
response.
But if I fire multiple concurrent requests, then it's again waiting
indefinitely rather than timing out (for both SHARED/EXCLUSIVE modes).
Please clarify the following,
1. Why is it not timing out for more concurrent requests?
2. Why is it executing it in Async mode when it's configured as false (Refer
the stack trace below)?

>From tomcat thread dump, all threads are waiting in CountDownLatch.await
though we are NOT using async mode.
Queue Config:
jms:queue:QUEUE.REQUEST?replyTo=SYNC.REPLY&?useMessageIDAsCorrelationID=true&receiveTime=1000&preserveMessageQos=true&replyToType=Shared&disableReplyTo=false
Stack trace from thread dump:
"ajp-bio-8010-exec-349" daemon prio=10 tid=0x0000000005eaf000 nid=0x73f9
waiting on condition [0x0000000054758000]
java.lang.Thread.State: WAITING (parking)
at sun.misc.Unsafe.park(Native Method)
parking to wait for <0x00000000be675930> (a
java.util.concurrent.CountDownLatch$Sync)
at java.util.concurrent.locks.LockSupport.park(LockSupport.java:186)
at
java.util.concurrent.locks.AbstractQueuedSynchronizer.parkAndCheckInterrupt(AbstractQueuedSynchronizer.java:834)
at
java.util.concurrent.locks.AbstractQueuedSynchronizer.doAcquireSharedInterruptibly(AbstractQueuedSynchronizer.java:994)
at
java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireSharedInterruptibly(AbstractQueuedSynchronizer.java:1303)
at java.util.concurrent.CountDownLatch.await(CountDownLatch.java:236)
at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:115)
at
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:86)
at
org.apache.camel.processor.UnitOfWorkProducer.process(UnitOfWorkProducer.java:63)
at
org.apache.camel.impl.ProducerCache$2.doInProducer(ProducerCache.java:360)
at
org.apache.camel.impl.ProducerCache$2.doInProducer(ProducerCache.java:331)
at org.apache.camel.impl.ProducerCache.doInProducer(ProducerCache.java:227)
at org.apache.camel.impl.ProducerCache.sendExchange(ProducerCache.java:331)
at org.apache.camel.impl.ProducerCache.send(ProducerCache.java:186)
at
org.apache.camel.impl.DefaultProducerTemplate.send(DefaultProducerTemplate.java:115)
at
org.apache.camel.impl.DefaultProducerTemplate.sendBody(DefaultProducerTemplate.java:119)
at
org.apache.camel.impl.DefaultProducerTemplate.sendBody(DefaultProducerTemplate.java:136)
at
org.apache.camel.impl.DefaultProducerTemplate.requestBody(DefaultProducerTemplate.java:284)



--
View this message in context: http://camel.465427.n5.nabble.com/Setting-a-requestTimeout-for-a-shared-Exclusive-reply-does-not-take-effect-for-multiple-concurrent-us-tp5733811.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Setting a requestTimeout for a shared/Exclusive reply does not take effect for multiple concurrent users

Posted by Siva B <kb...@yahoo.com.sg>.
It's just an URI in producer template



--
View this message in context: http://camel.465427.n5.nabble.com/Setting-a-requestTimeout-for-a-shared-Exclusive-reply-does-not-take-effect-for-multiple-concurrent-us-tp5733811p5734028.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Setting a requestTimeout for a shared/Exclusive reply does not take effect for multiple concurrent users

Posted by Claus Ibsen <cl...@gmail.com>.
And what is the Camel route if using any? Or just that uri from a
producer template?

And btw the producer template is waiting for a reply hence why its
blocking. And if the reply/timeout takes a long to trigger then it
still blocks.


On Thu, Jun 6, 2013 at 6:50 PM, Siva B <kb...@yahoo.com.sg> wrote:
> Here is the camel-context XML configuration. WebSphereDestinationResolver
> implements Camel's DestinationResolver and overrides resolveDestination
> method.
>
>         <camelContext xmlns="http://camel.apache.org/schema/spring">
>                 <template id="camelTemplate" />
>         </camelContext>
>
>         <bean id="wmq" class="org.apache.camel.component.jms.JmsComponent">
>                 <property name="connectionFactory" ref="credentials" />
>                 <property name="destinationResolver" ref="webSphereDestinationResolver" />
>                 <property name="receiveTimeout"
>                         value="${receiveTimeout}"></property>
>                 <property name="requestTimeout"
>                         value="${requestTimeout}" />
>         </bean>
>         <bean id="webSphereDestinationResolver"
>                 class="XXXXXX.WebSphereDestinationResolver" />
>         <bean id="credentials"
>
> class="org.springframework.jms.connection.UserCredentialsConnectionFactoryAdapter">
>                 <property name="targetConnectionFactory">
>                         <ref bean="cachingConnectionFactory" />
>                 </property>
>                 <property name="username"
>                         value="${username}">
>                 </property>
>                 <property name="password"
>                         value="${password}">
>                 </property>
>         </bean>
>
>         <bean id="cachedConnectionFactory"
> class="org.springframework.jms.connection.CachingConnectionFactory"
>         p:targetConnectionFactory-ref="queueConnectionFactory"
>         p:reconnectOnException="true"
>         p:sessionCacheSize="75" />
>
>
>         <bean id="queueConnectionFactory"
> class="org.springframework.jndi.JndiObjectFactoryBean" lazy-init="true">
>                 <property name="jndiName"
> value="java:comp/env/jms/MQConnectionFactory" />
>         </bean>
>
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Setting-a-requestTimeout-for-a-shared-Exclusive-reply-does-not-take-effect-for-multiple-concurrent-us-tp5733811p5733958.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
www.camelone.org: The open source integration conference.

Red Hat, Inc.
FuseSource is now part of Red Hat
Email: cibsen@redhat.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen

Re: Setting a requestTimeout for a shared/Exclusive reply does not take effect for multiple concurrent users

Posted by Siva B <kb...@yahoo.com.sg>.
Here is the camel-context XML configuration. WebSphereDestinationResolver
implements Camel's DestinationResolver and overrides resolveDestination
method. 

	<camelContext xmlns="http://camel.apache.org/schema/spring">
		<template id="camelTemplate" />
	</camelContext>
		
	<bean id="wmq" class="org.apache.camel.component.jms.JmsComponent">
		<property name="connectionFactory" ref="credentials" />
		<property name="destinationResolver" ref="webSphereDestinationResolver" />
		<property name="receiveTimeout"
			value="${receiveTimeout}"></property>
		<property name="requestTimeout"
			value="${requestTimeout}" />
	</bean>
	<bean id="webSphereDestinationResolver"
		class="XXXXXX.WebSphereDestinationResolver" />
	<bean id="credentials"
	
class="org.springframework.jms.connection.UserCredentialsConnectionFactoryAdapter">
		<property name="targetConnectionFactory">
			<ref bean="cachingConnectionFactory" />
		</property>
		<property name="username"
			value="${username}">
		</property>
		<property name="password"
			value="${password}">
		</property>
	</bean>

	<bean id="cachedConnectionFactory"
class="org.springframework.jms.connection.CachingConnectionFactory" 
	p:targetConnectionFactory-ref="queueConnectionFactory"  
	p:reconnectOnException="true"
	p:sessionCacheSize="75" />  

	
	<bean id="queueConnectionFactory"
class="org.springframework.jndi.JndiObjectFactoryBean" lazy-init="true">
	        <property name="jndiName"
value="java:comp/env/jms/MQConnectionFactory" />
	</bean> 
	



--
View this message in context: http://camel.465427.n5.nabble.com/Setting-a-requestTimeout-for-a-shared-Exclusive-reply-does-not-take-effect-for-multiple-concurrent-us-tp5733811p5733958.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Setting a requestTimeout for a shared/Exclusive reply does not take effect for multiple concurrent users

Posted by Claus Ibsen <cl...@gmail.com>.
How have you configured the jms component and your connection factory et all?


On Wed, Jun 5, 2013 at 5:29 PM, Siva B <kb...@yahoo.com.sg> wrote:
> *OS *- RHEL 5.3
> *Tomcat *- 7.0.39
> *JDK *- 1.7
> *Spring *- 3.0.2
> *WebSphere MQ* - 7.0
> *Camel version* - 2.10.4
> *Component/s:* camel-core, camel-jms
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Setting-a-requestTimeout-for-a-shared-Exclusive-reply-does-not-take-effect-for-multiple-concurrent-us-tp5733811p5733897.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
www.camelone.org: The open source integration conference.

Red Hat, Inc.
FuseSource is now part of Red Hat
Email: cibsen@redhat.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen

Re: Setting a requestTimeout for a shared/Exclusive reply does not take effect for multiple concurrent users

Posted by Siva B <kb...@yahoo.com.sg>.
*OS *- RHEL 5.3
*Tomcat *- 7.0.39
*JDK *- 1.7
*Spring *- 3.0.2
*WebSphere MQ* - 7.0
*Camel version* - 2.10.4
*Component/s:* camel-core, camel-jms



--
View this message in context: http://camel.465427.n5.nabble.com/Setting-a-requestTimeout-for-a-shared-Exclusive-reply-does-not-take-effect-for-multiple-concurrent-us-tp5733811p5733897.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Setting a requestTimeout for a shared/Exclusive reply does not take effect for multiple concurrent users

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

Read this page how to get help and what you can do yourself, and what
detail to report for better chance of getting help
http://camel.apache.org/support

On Tue, Jun 4, 2013 at 5:00 PM, Siva B <kb...@yahoo.com.sg> wrote:
> Setting requestTimeout of 1 second and receiveTimeout of 250 milliseconds
> timing out right after 1 second for a single request if there is no
> response.
> But if I fire multiple concurrent requests, then it's again waiting
> indefinitely rather than timing out (for both SHARED/EXCLUSIVE modes).
> Please clarify the following,
> 1. Why is it not timing out for more concurrent requests?
> 2. Why is it executing it in Async mode when it's configured as false (Refer
> the stack trace below)?
>
> From tomcat thread dump, all threads are waiting in CountDownLatch.await
> though we are NOT using async mode.
> Queue Config:
> jms:queue:QUEUE.REQUEST?replyTo=SYNC.REPLY&?useMessageIDAsCorrelationID=true&receiveTime=1000&preserveMessageQos=true&replyToType=Shared&disableReplyTo=false
> Stack trace from thread dump:
> "ajp-bio-8010-exec-349" daemon prio=10 tid=0x0000000005eaf000 nid=0x73f9
> waiting on condition [0x0000000054758000]
> java.lang.Thread.State: WAITING (parking)
> at sun.misc.Unsafe.park(Native Method)
> parking to wait for <0x00000000be675930> (a
> java.util.concurrent.CountDownLatch$Sync)
> at java.util.concurrent.locks.LockSupport.park(LockSupport.java:186)
> at
> java.util.concurrent.locks.AbstractQueuedSynchronizer.parkAndCheckInterrupt(AbstractQueuedSynchronizer.java:834)
> at
> java.util.concurrent.locks.AbstractQueuedSynchronizer.doAcquireSharedInterruptibly(AbstractQueuedSynchronizer.java:994)
> at
> java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireSharedInterruptibly(AbstractQueuedSynchronizer.java:1303)
> at java.util.concurrent.CountDownLatch.await(CountDownLatch.java:236)
> at
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:115)
> at
> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:86)
> at
> org.apache.camel.processor.UnitOfWorkProducer.process(UnitOfWorkProducer.java:63)
> at
> org.apache.camel.impl.ProducerCache$2.doInProducer(ProducerCache.java:360)
> at
> org.apache.camel.impl.ProducerCache$2.doInProducer(ProducerCache.java:331)
> at org.apache.camel.impl.ProducerCache.doInProducer(ProducerCache.java:227)
> at org.apache.camel.impl.ProducerCache.sendExchange(ProducerCache.java:331)
> at org.apache.camel.impl.ProducerCache.send(ProducerCache.java:186)
> at
> org.apache.camel.impl.DefaultProducerTemplate.send(DefaultProducerTemplate.java:115)
> at
> org.apache.camel.impl.DefaultProducerTemplate.sendBody(DefaultProducerTemplate.java:119)
> at
> org.apache.camel.impl.DefaultProducerTemplate.sendBody(DefaultProducerTemplate.java:136)
> at
> org.apache.camel.impl.DefaultProducerTemplate.requestBody(DefaultProducerTemplate.java:284)
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Setting-a-requestTimeout-for-a-shared-Exclusive-reply-does-not-take-effect-for-multiple-concurrent-us-tp5733811.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
www.camelone.org: The open source integration conference.

Red Hat, Inc.
FuseSource is now part of Red Hat
Email: cibsen@redhat.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen