---
schema_version: "1"
id: 470ce907f00e597a9e98c87122dc8f5f219e2cc42b3246dfcc97796cf9e833e4
title: Upgrading and Migrating JMS Connector to Version 2.x
collection: mulesoft
version: current
locale: en-us
portal_url: https://docs.salesforce.com/mulesoft/current/en-us/jms-connector/latest/jms-connector-upgrade-migrate.md
canonical_url: https://docs.mulesoft.com/jms-connector/latest/jms-connector-upgrade-migrate
source_site: docs.mulesoft.com
content_type: documentation
content_hash: 86b8025463c8e2261a5ce61303989fb2aa9fec1e3ed77717def8fe380ef873ea
description: MuleSoft Documentation Site
release: "2.0"
latest: true
---
---
product: JMS Connector
version: 2.0
is-latest-version: true
---

# Upgrading and Migrating JMS Connector to Version 2.x

> For the full documentation index, see: https://docs.mulesoft.com/llms.txt

Upgrade Anypoint Connector for JMS (JMS Connector) to version 2.x.

## Supported Upgrade Paths

<table><colgroup><col> <col></colgroup><thead><tr><th>From Version</th><th>To Version</th></tr></thead><tbody><tr><td><div><div><p>1.x</p></div></div></td><td><div><div><p>2.x</p></div></div></td></tr></tbody></table>

## 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-api` library is upgraded to version 3.1.0, replacing `javax.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:

```xml
<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:

```xml
<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:

<table><colgroup><col> <col></colgroup><thead><tr><th>Application/Service</th><th>Version</th></tr></thead><tbody><tr><td><p>Mule runtime</p></td><td><p>4.10.0 and later</p></td></tr><tr><td><p>Java</p></td><td><p>17</p></td></tr></tbody></table>

## 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:

1.  In Anypoint Studio, create a Mule project.

2.  In the **Mule Palette** view, click **Search in Exchange**.

3.  In **Add Dependencies to Project**, enter `jms` in the search field.

4.  In **Available modules**, select **JMS Connector** and click **Add**.

5.  Click **Finish**.

6.  Verify that the JMS Connector dependency version is `2.x` in the project’s `pom.xml` file.

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:

1.  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**

2.  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.

3.  Remove any reference to the **Enable Xa** field, if present, because it no longer exists on the
    ActiveMQ connection factory configuration.

4.  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](https://docs.mulesoft.com/jms-connector/latest/jms-xa-transactions).

## Verify the Upgrade

After you install the latest version of the connector, follow these steps to verify the upgrade:

1.  In Studio, verify that there are no errors in the **Problems** or **Console** views.

2.  Verify that there are no problems in the project `pom.xml` file.

3.  Test the connection to verify that the operations work.

4.  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.

## See Also

- [Configuring XA Transactions in JMS Connector](https://docs.mulesoft.com/jms-connector/latest/jms-xa-transactions)

- [Configure an ActiveMQ Connection for JMS Connector](https://docs.mulesoft.com/jms-connector/latest/jms-activemq-configuration)

- [Introduction to Anypoint Connectors](https://docs.mulesoft.com/connectors/introduction/introduction-to-anypoint-connectors)

- [Salesforce Help](https://help.salesforce.com)
