Cassandra
The Cassandra server feature in WSO2 Data Services Server provides in-built support to expose data from a Cassandra data source (versions 1.1.0 or later) as a service. The feature that is compatible with Cassandra version 1.1.0 and later is as follows:
Name : Cassandra-JDBC-1.2.5 server Feature
Identifier : org.wso2.carbon.cassandra-jdbc-1.2.5.server.feature.group
In order to use Cassandra server versions older than 1.1.0, uninstall the above feature according to the instruction given in section Installing and Managing Features and install the cassandra-jdbc-1.0.5 feature. Also, WSO2 Storage Server facilitates creating and maintaining Cassandra clusters, keyspaces and column families. For information, see WSO2 Storage Server Documentation.
First, create a simple Cassandra keyspace and add some columns to work with. Here are sample Cassandra CLI commands to perform this tasks:
create keyspace Keyspace1; use Keyspace1; create column family USER with comparator=UTF8Type and key_validation_class=UTF8Type and column_metadata=[{column_name: user_id, validation_class: UTF8Type, index_type: KEYS}, {column_name: username, validation_class: UTF8Type}, {column_name: password, validation_class: UTF8Type}]; set USER[user1][username]='test'; set USER[user1][password]='testpwd';
You can now create your Cassandra data source as you create the data service: Follow the steps from 1 to 3 in creating a data service using various data sources. When you get to the Add New Data Source screen, select Cassandra as the data source type. The Cassandra-specific options will be available for editing as shown below.
To write a query to this datasource, see Sample 2: Adding output mappings to a query or read everything about query writing in Writing Data Service Queries.