1.x
Upgrading and Migrating JMS Connector to Version 2.x
Upgrade Anypoint Connector for JMS (JMS Connector) to version 2.x.
Changes in This Release
JMS Connector 2.x contains the following changes:
-
This connector is now compatible with Java 17 only.
-
The Enable xa field is removed from the ActiveMQ connection factory configuration.
-
JMS Connector provides separate connection types for XA and non-XA transactions. You can now select the new ActiveMQ XA Connection or Generic XA Connection type in the JMS Config window. These new connection types replace the previous Enable xa toggle on a single connection.
-
The existing ActiveMQ Connection and Generic Connection types are now used only for non-XA scenarios.
-
The deprecated ActiveMQ Connection - No Connectivity Test connection type is removed. There is no replacement connection type. Use ActiveMQ Connection instead.
-
The XA connection pool configuration (Max pool size and Max idle seconds) now applies only to the XA connection types. The Min pool size field no longer exists.
-
These libraries are upgraded:
-
The
jakarta.jms-apilibrary is upgraded to version 3.1.0, replacingjavax.jms-api. -
The Spring framework is upgraded to version 6.2.15.
-
The Apache ActiveMQ library is upgraded to version 6.1.0.
-
The Apache ActiveMQ Artemis library is upgraded to version 2.50.0.
-
In version 1.x, you configured XA transactions on the standard ActiveMQ connection:
<jms:config name="JMS_Config">
<jms:active-mq-connection username="admin"
password="admin">
<jms:factory-configuration brokerUrl="tcp://localhost:61616"/>
<jms:xa-connection-pool minPoolSize="1"
maxPoolSize="10"
maxIdleSeconds="45"/>
</jms:active-mq-connection>
</jms:config>
In version 2.x, configure XA transactions using the new ActiveMQ XA Connection connection type:
<jms:config name="JMS_Config">
<jms:active-mq-xa-connection username="admin"
password="admin">
<jms:factory-configuration brokerUrl="tcp://localhost:61616"/>
<jms:xa-connection-pool maxPoolSize="32"
maxIdleSeconds="60"/>
</jms:active-mq-xa-connection>
</jms:config>
Non-XA connections that use the ActiveMQ Connection type require no changes. If your application uses the removed ActiveMQ Connection - No Connectivity Test type, switch to ActiveMQ Connection (or ActiveMQ XA Connection, if the application also requires XA transactions).
Requirements
Ensure your system meets the following compatibility requirements before you perform the upgrade:
| Application/Service | Version |
|---|---|
Mule runtime |
4.10.0 and later |
Java |
17 |
Upgrade Prerequisites
Before you perform the upgrade, create a backup of your files, data, and configuration in case you need to restore to the previous version.
Upgrade Steps
Follow these steps to perform the upgrade to version 2.x:
-
In Anypoint Studio, create a Mule project.
-
In the Mule Palette view, click Search in Exchange.
-
In Add Dependencies to Project, enter
jmsin the search field. -
In Available modules, select JMS Connector and click Add.
-
Click Finish.
-
Verify that the JMS Connector dependency version is
2.xin the project’spom.xmlfile.
Studio upgrades the connector automatically.
Post-Upgrade Steps
After you install the latest version of the connector, complete the following steps if your application uses XA transactions:
-
In each JMS Config global element that uses XA transactions, change the Connection field to the corresponding XA connection type:
-
ActiveMQ Connection → ActiveMQ XA Connection
-
Generic Connection → Generic XA Connection
-
-
Move any XA connection pool configuration (Max pool size and Max idle seconds) to the new XA connection element. Remove any Min pool size value, because this field no longer exists.
-
Remove any reference to the Enable Xa field, if present, because it no longer exists on the ActiveMQ connection factory configuration.
-
If any JMS Config global element uses the removed ActiveMQ Connection - No Connectivity Test connection type, change the Connection field to ActiveMQ Connection (or ActiveMQ XA Connection if the application also requires XA transactions).
For more information, see Configuring XA Transactions in JMS Connector.
Verify the Upgrade
After you install the latest version of the connector, follow these steps to verify the upgrade:
-
In Studio, verify that there are no errors in the Problems or Console views.
-
Verify that there are no problems in the project
pom.xmlfile. -
Test the connection to verify that the operations work.
-
If your app uses XA transactions, verify that the corresponding XA connection type is configured and that transactions still commit and roll back as expected.
Revert the Upgrade
If it is necessary to revert to the previous version of JMS Connector, change the mule-jms-connector dependency version in the project’s pom.xml file to the previous version, and revert any XA connection elements back to their equivalent non-XA connection type with the Enable Xa field set. If you switched away from the removed ActiveMQ Connection - No Connectivity Test connection type as part of the upgrade, you can restore it after reverting.
You must update the project’s pom.xml file in Anypoint Studio.



