简体   繁体   中英

Mule XA Transaction not working with VM and JMS

I've a flow with VM inbound end-point and JMS outbound end-point. When I start XA transaction with VM and JMS, It throws an exception in infinite loop. I tried with different transaction type but it throws same exception. Any pointers??

I've another flow that drop massages in VM://abc123. Now I'm pulling those messages from VM and dropping into JMS queue.

<flow name="transactionMainFlow_202_EQueue_JMS" doc:name="transactionMainFlow_202_EQueue_JMS">
    <vm:inbound-endpoint exchange-pattern="one-way"  doc:name="VM" path="abc123">
        <xa-transaction action="ALWAYS_BEGIN"/>
    </vm:inbound-endpoint>
    <timer-interceptor />
     <jms:outbound-endpoint queue="${om_request_queue}"
            connector-ref="Offering_Messaging_Connector" doc:name="OM_JMS_Request_Queue">
        <xa-transaction action="BEGIN_OR_JOIN"/>
      </jms:outbound-endpoint>
        <catch-exception-strategy doc:name="Catch Exception Strategy">
            <logger message="#[exception]" level="ERROR" category="Exception"
                doc:name="Logger" />
        </catch-exception-strategy>
</flow>

Exception:

ERROR 2014-10-13 22:55:32,596 [[transaction-orch].VM_Connector.receiver.04] org.mule.exception.DefaultSystemExceptionStrategy: 
********************************************************************************
Message               : Can not start XA transaction
Code                  : MULE_ERROR-95
--------------------------------------------------------------------------------
Exception stack is:
1. Object of type "javax.transaction.TransactionManager" with name "Transaction Manager" is not available in the registry (java.lang.IllegalStateException)
  org.mule.transaction.XaTransaction:53 (null)
2. Can not start XA transaction (org.mule.api.transaction.TransactionException)
  org.mule.transaction.XaTransactionFactory:33 (http://www.mulesoft.org/docs/site/current3/apidocs/org/mule/api/transaction/TransactionException.html)
--------------------------------------------------------------------------------
Root Exception stack trace:
java.lang.IllegalStateException: Object of type "javax.transaction.TransactionManager" with name "Transaction Manager" is not available in the registry
    at org.mule.transaction.XaTransaction.doBegin(XaTransaction.java:53)
    at org.mule.transaction.AbstractTransaction.begin(AbstractTransaction.java:62)
    at org.mule.transaction.XaTransactionFactory.beginTransaction(XaTransactionFactory.java:28)
    + 3 more (set debug level logging or '-Dmule.verbose.exceptions=true' for everything)

Any help would be appreciated.

Transaction Manager Reference need to be configured if XA transaction are enabled

if you choose the JBoss Transaction Manager Reference add global property

<jbossts:transaction-manager > <property key="com.arjuna.ats.arjuna.coordinator.defaultTimeout" value="47" /><!-- this is in seconds --> <property key="com.arjuna.ats.arjuna.coordinator.txReaperTimeout" value="108000"/><!-- this is in milliseconds --> </jbossts:transaction-manager>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM