camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From paulvitic <>
Subject JMS queue consumer hangs
Date Wed, 06 Apr 2011 11:33:45 GMT
I have a route with a JMS consumer as starting endpoint. The configuration
details of the endpoint are as follows:

connectionFactory = org.apache.activemq.pool.PooledConnectionFactory
explicitQosEnabled = true
deliveryPersistent = false
timeToLive = 3600000
sessionAcknowledgeModeName = AUTO_ACKNOWLEDGE

The purpose of this route is to send some text based messages to remote
clients either via TCP or if there is no live TCP connection with the client
send the message via appropriate HTTP or SMPP gateways. 

The throughput of the route is intermittent, i.e. sometime there are
approxiamtely 20 messages per second and sometimes there are 1 message per

The first endpoint on the route is a processor which checks if recipient
client has a live MINA TCP session and if so sends the message with the
following code snipplet: 

if (session != null && session.isConnected()) {	
			WriteFuture future = session.write(rawMessage);
			future.join(10 * 1000L);
			if (!future.isWritten()) {"Cannot write body: " + rawMessage + " using session: " +
				throw new CamelExchangeException("Cannot write body", exchange);
			} else {
				outgoing.setPosted(true);"GPRS:ยป " + rawMessage.replaceAll("(\\r|\\n)", ""));

if not it routes the message to subsequent HTTP or SMPP based endpoint based
on condition. Here is the route DSL:


The route generally works fine. I can see messages going out from any of the
producer endpoints when appropriate conditions are met.

However, at times that I can not specify the JMS consumer hangs. Messages
build up on the queue. I can not restart the route via Camel JMX extensions.
When I try to shutdown I get the following message:

DefaultShutdownStrategy - Waiting as there are still 1 inflight and pending
exchanges to complete, timeout in 299 seconds.

Any advise on how I can improve the route so I dont get into this situation
(may be by tweaking JMS configuration or using asynchronous processors etc.)
and/or how I can recover from the hung route is welcome.

Thanks in advance,

View this message in context:
Sent from the Camel - Users mailing list archive at

View raw message