camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From anupamsen <anupam...@yahoo.com>
Subject Re: some routing error in XA transaction
Date Tue, 11 Sep 2012 07:08:24 GMT
I too faced the same issue, was puzzled a lot. In my case I was having 2
transaction managers, 1 was for JpaTransactionManager for hibernate usage
for database operations and I wanted another transaction manager for
JmsTransactionManager. I am not sure why this is thrown.

Though I tweaked some of the configuration and defined the following-
  <jee:jndi-lookup id="XlConnectionFactory"
jndi-name="QueueConnectionFactory">
    <jee:environment>
      java.naming.factory.initial=weblogic.jndi.WLInitialContextFactory
      java.naming.provider.url=t3://localhost:8001
    </jee:environment>
  </jee:jndi-lookup>
  
  
  <bean id="txManager"
class="org.springframework.jms.connection.JmsTransactionManager">
      <property name="connectionFactory" ref="XlConnectionFactory"/>
  </bean>
  
  <bean id="PROPAGATION_REQUIRED"
class="org.apache.camel.spring.spi.SpringTransactionPolicy">
    <property name="transactionManager" ref="txManager"/>
    *<property name="propagationBehaviorName"
value="PROPAGATION_REQUIRED"/>*
  </bean>
  
  
  <bean id="jms" class="org.apache.camel.component.jms.JmsComponent">
    <property name="connectionFactory" ref="XlConnectionFactory"/>
    *<property name="transacted"  value="true"/>*
    <property name="transactionManager" ref="txManager"/>
  </bean>

The route was later configured below -

    <route id="saveCommodityRoute"
errorHandlerRef="DLCErrorHandler-SaveCommodity">
      <from
uri="jms:queue:XL-JMS-Server/saveCommodity?concurrentConsumers=3" />
      *<camel:transacted ref="PROPAGATION_REQUIRED"/>*

This solved the issue. Hope this helps.



--
View this message in context: http://camel.465427.n5.nabble.com/some-routing-error-in-XA-transaction-tp5714417p5719080.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Mime
View raw message