Over a million developers have joined DZone.

Introducing Anypoint Connector for Cassandra

DZone's Guide to

Introducing Anypoint Connector for Cassandra

Cassandra is used by many organizations to handle large amounts of data. Learn to integrate Apache Cassandra with the Cassandra Connector.

· Integration Zone ·
Free Resource

WSO2 is the only open source vendor to be named a leader in The Forrester Wave™: API Management Solutions, Q4 2018 Report. Download the report now or try out our product for free.

Apache is an open-source NoSQL database management system designed to handle large amounts of data across commodity hardware. Cassandra was initially developed at Facebook to power the Facebook inbox search feature, and became an Apache project in 2009. Since then, it has been adopted by more than 1,500 companies including Walmart, Netflix, Sony, Macy’s and UBS.

There are many ways customers use Cassandra within their organizations: to replace Oracle DB/SAN Storage with Cassandra, for front-end caching their e-commerce platform, or for storing historical financial data from a range of different sources. For those customers and others interested in exploring Cassandra, we are thrilled to announce the release of Anypoint for Cassandra.

In this blog, I’d like to walk you through a simple demo app to show how to use the Cassandra Connector. Before you start with the demo app, please make sure you have the Cassandra Connector v2.0.0 downloaded from the Exchange.

Image title

After you install the Cassandra Connector and import the demo app into Studio, you will see the following flows.

Image title

Let us configure the Cassandra Connector first. If you go to Global Elements, you will find “CassandraDB.” After selecting “CassandraDB,” please click on “Edit.”

Image title

In the CassandraDB: Configuration, you can specify the configuration of your Cassandra server. You can directly add your Cassandra information in the configuration, but I recommend you use the properties file to add your configuration information.

mule-app.properties include the following keys-value pairs:

  • username=
  • password=
  • host=
  • keyspace=demo (In this demo, I will use a “demo” key space.)
  • port=

After you complete the configuration for your Cassandra environment, let us run this app. When you open up a browser and hit localhost:8081, your browser will show the following page.

Image title

I will create a “demo” table with three columns: id, name, and event. As you can see below, id is set as a Partition Key (Primary Key) in the Mule table.

Image title

Before we start to add items to a “demo” table, I should mention that one of the key features the connector offers is showing you the metadata. If you go to the “Insert” flow in Studio, you can see the demo table has id, name, and event as columns.

Image title

Let us add a couple of items with the “Insert into DEMO table.”

Image title

After you added items, you can execute a CQL statement to retrieve items from the table. The connector supports “Execute a CQL statement,” but also provides easier ways to execute the CRUD operations with following operations: Select, Insert, Update, and Delete.

Image title

Let us retrieve items from the demo table.

Image title

For new users, try the above example to get started, and for others, please share with us how you are planning to use the Cassandra Connector!

Read the WSO2 Methodology for Agility to see how you can transform your integration projects from semi-agile to a scalable continuous agile approach.

integration ,cassandra ,connectors ,anypoint connector ,tutorial

Published at DZone with permission of

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}