camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tianchi <>
Subject configure transaction timeout in camel route
Date Thu, 30 Aug 2012 01:31:26 GMT
Hi All,

I have a question about how to configure time out for camel route
transaction. I am using servicemix 4.4.1 and Camel 2.8.0. I am trying to set
a time out to the transactions used by my camel routes so if any step in
route take too long time, the transaction can roll back and message could be
requeued. I tried to search for a similar use case but failed finding a
clear example. I tried setting a defaulttimeout in transaction manager and
setting a transactionTimeout in jmsComponent, but it didn't work as I
expected. It would be great that someone can help me take a look if I did
anything wrong.

I have my beans.xml file configured as the following:
  <bean id="mkt-jms" class="org.apache.camel.component.jms.JmsComponent">
    <property name="transacted" value="true"/>
    <property name="transactionManager" ref="txManager"/>
    <property name="connectionFactory" ref="jmsConnectionFactory"/>
    <property name="transactionTimeout" value="20000"/>

  <bean id="txManager"
    <property name="connectionFactory" ref="jmsConnectionFactory"/>
    <property name="defaultTimeout" value="20"/>
  <bean id="jmsConnectionFactory"
    <property name="brokerURL" value="vm://mkt-mq"/>

  <bean id="propagationRequiredPolicy"
    <property name="transactionManager" ref="txManager"/>
    <property name="propagationBehaviorName" value="PROPAGATION_REQUIRED"/>

I wrote my route as the following, I let the thread sleep for 60 secs in the
sleep function, and was hopping a time out could occurred:

    from("mkt-jms:queue:Mkt.Queue." + getQueueName() + ".Standard")
    .dynamicRouter(bean(DynamicRouterFileTransfer.class, "sleep"))
    .to("cxf:bean:" + getService())

Thanks a lot.

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

View raw message