camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wing-tung Leung <>
Subject JMS request-reply and transactions
Date Mon, 24 Oct 2011 16:21:02 GMT

I want to setup 2 separate routes in my camel context to create a
synchronous spring bean method, which triggers a JMS based request-reply

The front (synchronous) bean is invoked via a simple Spring web MVC
controller, and dumps the response back to the browser. The second route, in
a separate transaction, pulls the message from the request queue, performs a
simple transformation and puts the response back into (shared) response
queue (both queues from external IBM MQ server).

At first, things were looking fine, because my browser page renders the
response as expected. But in a second look, I discovered that the log still
mentions a timeout (default 20 secs) waiting for the reply, although the
reply has been received already! And secondly, after the timeout, the
response message (re-) occurs on the response queue, and remains there.

I assume the reply handler is missing some transaction commit, causing some
automatic rollback, so the reply bounces back to the reply queue. Is that

How should/can I avoid this? I have read something about the
"transactedInOut" option, but it is currently deprecated, and setting it on
the request queue doesn't seem to help.

This is the proxy and surrounding request-reply route:

<bean id="testHelloProxy"
  <property name="serviceUrl" value="direct:testHello"/>
  <property name="serviceInterface"

<camel:route id="testHello" autoStartup="true">
  <from uri="direct:testHello" />
  <camel:inOut uri="{{jms.queue.test.request}}"/>

And the dummy echo service on the other side:

<route id="testEcho" autoStartup="true">
  <from uri="{{jms.queue.test.request}}" />
  <camel:transacted />
      <simple>Hello ${body} (id ${id}) </simple>
  <setHeader headerName="JMSCorrelationID">
  <to uri="{{jms.queue.test.reply}}" />

Last, the 2 external IBM MQ queues referred by JNDI, including some camel



Running on camel-2.6.0, inside IBM WebSphere 6.1 and IBM MQ, most resources
referred by JNDI.

Any help pointing me into the good direction is greatly appreciated!



  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message