Upgrade Anypoint Connector for Apache Cassandra (Apache Cassandra Connector) from version 4.x to version 5.x.
Changes
5.0
-
This connector now supports Apache Cassandra 5.x. The connector now uses DataStax Java Driver 4.17.0.
-
The Cassandra Cluster Name field is removed from Studio. It no longer appears on the General or Advanced Settings tab. Applications that still set
clusterNameoncassandra-db:connectionfail to deploy. Delete the attribute. Contact points and Cassandra Cluster Nodes still select the cluster. -
The new Local Datacenter field is on the Advanced Settings tab. It sets the local datacenter for the driver’s load-balancing policy. Set this field when contact points don’t share one datacenter, such as in a multi-DC cluster. You can omit it for single-DC clusters.
-
The new Request Timeout (ms) field is on the Advanced Settings tab. It sets the per-request timeout for CQL operations. The default is
12000milliseconds, which preserves the 12-second deadline from version 4.1. -
On Apache Cassandra 5.x, the Change Column Type operation fails because Cassandra no longer supports altering column types. Add a new column, backfill the data, then drop the old column.
-
TLS configuration now applies to the driver. The default Endpoint identification algorithm is
DISABLED. If your XML still setsHTTPSorLDAPS, version 5.0 validates the server certificate against the host. -
Don’t select native protocol
V1orV2. Those values fail at application initialization. Leave Protocol Version unset to let the driver negotiate, including native protocol V5 on Apache Cassandra 5.x. -
These libraries are upgraded to address reported security vulnerabilities:
-
The
jackson-coreandjackson-databindlibraries are upgraded to version 2.22.2. -
The
netty-codeclibrary is upgraded to version 4.2.0.Final. -
The
netty-handlerlibrary is upgraded to version 4.1.137.Final. -
The
guavalibrary is upgraded to version 32.1.3-jre. -
The
jnr-posixlibrary is upgraded to version 3.2.2. -
The
commons-lang3library is upgraded to version 3.20.0. -
The
commons-collections4library is upgraded to version 4.6.0.
-
Requirements
Ensure your system meets the following compatibility requirements before you perform the upgrade:
| Application/Service | Version |
|---|---|
Mule runtime |
4.6.0 and later |
Java |
8, 11, and 17 |
Apache Cassandra |
5.x |
DataStax Java Driver |
4.17.0 |
Mule versions 4.1 through 4.5 aren’t supported. Applications on these versions must remain on Apache Cassandra Connector 4.1.x.
Upgrade Prerequisites
Before you perform the upgrade, you must:
-
Create a backup of your files, data, and configuration in case you need to restore to the previous version.
-
Ensure that your environment meets the version 5.x requirements, including Mule 4.6.0 or later.
-
Delete
clusterNamefrom everycassandra-db:connectionelement. If the attribute remains, the app fails to deploy. -
Set Local Datacenter on the Advanced Settings tab when the cluster is multi-DC or contact points don’t share one datacenter.
-
Review
tls:context. The default hostname validation isDISABLED. If XML still hasHTTPSorLDAPS, version 5.0 validates the certificate against the host. -
Leave Protocol Version unset, or select
V3orV4. Don’t selectV1orV2.
Upgrade Steps
Follow these steps to perform the upgrade from Apache Cassandra Connector 4.x to Apache Cassandra Connector 5.x:
-
In Anypoint Studio, create a Mule project.
-
In the Mule Palette view, click Search in Exchange.
-
In the Add Dependencies to Project window, enter
cassandrain the search field. -
In the Available modules section, select Cassandra and click Add.
-
Click Finish.
-
Verify that the Cassandra Connector dependency version is
5.x.xin thepom.xmlfile, wherex.xis the minor release and patch version number. For example, if you are upgrading to v5.0, the dependency version in thepom.xmlfile should be5.0.0.
Studio upgrades the connector automatically.
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.
-
Check the project
pom.xmlfile and verify that there are no problems. -
Test the connection and verify that the operations work.
Troubleshooting
If the app fails to deploy, check cassandra-db:connection for a clusterName attribute and delete it.
If the app fails to deploy with an InitialisationException that native protocol V1 or V2 is no longer supported, leave Protocol Version unset, or select V3 or V4.
If the connection fails against a multi-DC cluster, set Local Datacenter on the Advanced Settings tab to the datacenter that contains your contact points.
If Change Column Type fails with Altering column types is no longer supported, you are connected to Apache Cassandra 5.x. Add a new column, backfill the data, then drop the old column.
If the TLS handshake fails, the certificate might not match the host. Set Endpoint identification algorithm to DISABLED, or update the server certificate.