Contact Free trial Login

Single Resource Transactions

Mule Runtime Engine versions 3.5, 3.6, and 3.7 reached End of Life on or before January 25, 2020. For more information, contact your Customer Success Manager to determine how you can migrate to the latest Mule version.

Use a Single Resource transaction (also known as a simple transaction or local transaction) to send or receive messages using only one single resource: JMS, VM, or JDBC.

The example below illustrates a flow which includes a single resource transaction applied to inbound and outbound JMS connectors.

<flow name="testFlow1" doc:name="testFlow1">
        <jms:inbound-endpoint queue="test.in" connector-ref="JMS" doc:name="JMS">
            <jms:transaction action="ALWAYS_BEGIN"/>
        </jms:inbound-endpoint>
....
        <jms:outbound-endpoint doc:name="JMS" connector-ref="JMS" queue="test.out">
            <jms:transaction action="ALWAYS_JOIN"/>
        </jms:outbound-endpoint>
    </flow>

The configuration above defines a JMS connector that receives on a "test.in" queue and another JMS connector that sends on a "test.out" queue. The action attribute dictates how Mule initiates a transaction. Within this flow, Mule starts a new transaction for every message it receives (inbound connector), and always joins a transaction in progress for every message it sends (outbound connector). Mule commits only those messages which successfully pass through the complete flow; if at any point in the flow a message throws an exception, Mule rolls back the transaction.

Refer to Transaction Management for details on how to configure a Single Resource transaction.

Was this article helpful?

💙 Thanks for your feedback!

Edit on GitHub