Contact Us 1-800-596-4880

Configuring XA Transactions in JMS Connector

Anypoint Connector for JMS (JMS Connector) provides the option to use Extended Architecture Transactions (XA Transactions) when you configure the XA Connection Pool and the Transaction Type fields.

Before You Begin

Before getting started, ensure that you have an understanding of XA Transactions.

Configure XA Transactions

To configure XA transactions, follow these steps:

  1. In your JMS Config, configure the XA Connection Pool fields for Min pool size, Max pool size, and Max idle seconds:

 <jms:config name="JMS_Config">
        <jms:active-mq-connection brokerURL="tcp://localhost:61616"
                                  userName="admin"
                                  password="admin">
            <jms:xa-connection-pool minPoolSize="1"
                                    maxPoolSize="10"
                                    maxIdleSeconds="45"/>
        </jms:active-mq-connection>
    </jms:config>
xml
  1. Configure the JMS Listener source XA Transaction field to XA:

</flow>
    <flow name="JMS_Listener_Flow">
        <jms:listener
                destination="queue.in"
                config-ref="JMS_Config"
                transactionType="XA"
                transactionalAction="ALWAYS_BEGIN">
            <ee:transform>
                <ee:message>
                    <ee:set-payload><![CDATA[%dw 2.0
output application/json
---
payload]]></ee:set-payload>
                </ee:message>
            </ee:transform>
        </jms:listener>
        <vm:publish config-ref="VM_Config"
                    queueName="queue"
                    transactionType="XA"
                    transactionalAction="ALWAYS_JOIN"/>
    </flow>
xml

In the Configuration XML editor window, the Mule app configuration looks like this:

View on GitHub