Contact Free trial Login

Cassandra XML and Maven Support - Mule 4

If you manually code a Mule application in XML either from the Studio XML editor or standalone, to get access to a connector, you must:

  • Add the namespace for the connector to your XML flow.

  • Add dependency information to your Maven pom.xml file.

In the Studio visual editor, when you drag a connector from the palette to the canvas, Studio automatically populates the XML code with the connector namespace and schema location.

Add a Namespace for the Connector

If you manually code the Mule application in Studio’s XML editor or another text editor, paste the following into the header of your configuration XML, inside the <mule> tag:

http://www.mulesoft.org/schema/mule/cassandra-db
http://www.mulesoft.org/schema/mule/cassandra-db/current/mule-cassandra-db.xsd

Configure the Maven POM File

The pom.xml is a Maven file that Anypoint Studio generates that contains dependencies for a Mule app. When you code a Mule app manually, include this XML snippet in your pom.xml file to enable access to this connector. The Mule runtime engine translates the LATEST dependency keyword to the current version. When creating an app manually from the XML, set up the pom.xml for your project:

<repositories>
   <repository>
        <id>mule-ee-releases</id>
        <name>MuleEE Releases Repository</name>
        <url>https://repository-master.mulesoft.org/nexus/content/repositories/releases-ee/</url>
    <repository>
        <id>mule-ee-snapshots</id>
        <name>MuleEE Snapshots Repository</name>
        <url>https://repository-master.mulesoft.org/nexus/content/repositories/ci-snapshots/</url>
    </repository>
</repositories>

This snippet specifies a project dependency for a specific release version:

<dependency>
    <groupId>org.mule.connectors</groupId>
    <artifactId>mule-cassandra-connector</artifactId>
    <version>RELEASE</version>
    <classifier>mule-plugin</classifier>
</dependency>

This snippet adds and specifies a project dependency for the latest version:

<dependency>
    <groupId>org.mule.modules</groupId>
    <artifactId>mule-cassandra-connector</artifactId>
    <version>LATEST</version>
</dependency>

Next

Now that you have completed XML and Maven, you can try out the examples.

See Also

We use cookies to make interactions with our websites and services easy and meaningful, to better understand how they are used and to tailor advertising. You can read more and make your cookie choices here. By continuing to use this site you are giving us your consent to do this.