JBoss Transaction Manager Reference
|MuleSoft recommends against deployments to Mule 3.8. Standard Support for this version ended on November 16, 2018, and Mule 3.8 will reach its End of Life on November 16, 2021, when Extended Support ends.|
To configure an instance of the JBoss transaction manager within Mule, add this element to your Mule XML config file. You can configure arbitrary properties on the transaction manager that will be passed on to the underlying transaction manager. For example:
<jbossts:transaction-manager> <property key="test" value="TEST"/> </jbossts:transaction-manager>
You can then declare XA transactions on endpoints supporting XA transactions, and all those transactions are managed by the JBoss transaction manager. Mule auto-generates the transaction manager XA node ID. To specify the ID yourself, add the following property:
<jbossts:transaction-manager> <properties> <spring:entry key="com.arjuna.ats.arjuna.xa.nodeIdentifier" value="SomeUserNodeId"/> </properties> </jbossts:transaction-manager>
You can configure many properties for the JBoss Transaction Manager. These configurable properties are detailed in the Environment class.
The following is an example that demonstrates how to configure properties related to transaction timeout.
There are two properties that relate to timeouts for JBoss transactions. (Note that the information for timeout properties comes from here).
This defaultTimeout property defines the timeout period for each transaction created for this manager. Transactions that have not terminated before the timeout value expires are automatically rolled back. The default value is 60 seconds.
JBossTS uses a separate reaper thread that monitors all locally created transactions and forces them to roll back if their timeouts elapse. To prevent this reaper thread from consuming application time, it only runs periodically. By default, the reaper thread is set to monitor locally transactions every 120000 milliseconds. You can override this default value by setting the txReaperTimeout property. Note that if the defaultTimeout property value is less than the txReaperTimeout property value, the reaper thread checks for transactions once every defaultTimeout seconds.
<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>