camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jb3 <>
Subject Messages consumed from JmsComponent not marked as transacted
Date Thu, 27 Nov 2014 12:51:27 GMT

I am using Camel 2.10.4 (long overdue for an upgrade ;) )

I have configured a JmsComponent in xml to be transacted. However, when I
run the unit test below, the exchanges are marked as *not* being transacted.
If I add ".transacted()" to the java routing code, then
exchange.isTransacted() returns true. I was hoping though, to just configure
the JmsComponent to be transacted, and then all Exchanges coming from it to
be transacted.

Any help is greatly appreciated. Thanks!

Here is my code:

@ContextConfiguration(locations =

public class TransactedTest {

  public void  testTransactedness() throws InterruptedException {

  public final static class TestRouteBuilder extends RouteBuilder {
    public void configure() throws Exception {
      from("ibmmq:queue:test.q")  //if I add *transacted()* here, the
exchanges are marked as transacted
        .bean(new Tracker());

  public final static class Tracker implements Processor {
    public void process(Exchange exchange) throws Exception {
      System.out.println("Is exchange transacted: " +
exchange.isTransacted()); // always prints false



<bean id="routeBuilder" class="org.mycode.TransactedTest.TestRouteBuilder"
<camelContext id="camelTestContext"
  <routeBuilder ref="routeBuilder" />

<bean id="ibmmq" class="org.apache.camel.component.jms.JmsComponent">
  <property name="connectionFactory">
      <property name="targetConnectionFactory" ref="mqConnection" />
      <property name="sessionCacheSize" value="5" />
  <property name="transactionManager" ref="mqTransactionManager" />
  <property name="transacted" value="true" />
  <property name="testConnectionOnStartup" value="true" />
  <property name="lazyCreateTransactionManager" value="false" />
  <property name="acceptMessagesWhileStopping" value="true" />

<bean id="mqConnection" class="'>
  <property name="channel" value="SYSTEM.AUTO.SVRCONN" />
  <property name="transportType" value="1" />
  <property name="hostName" value="XXXXXXX" />
  <property name="port" value="XXXX" />
  <property name="queueManager" value="XXXXXXXX" />
  <property name="temporaryModel" value="XXXXXXXX" />
  <property name="tempQPrefix" value="XXXXXXXX" />

<bean id="mqTransactionManager"
  <property name="connectionFactory" ref="mqConnection" />

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

View raw message