Cassandra
Cassandra datasources allow you to create a data service using a Cassandra keyspace as the data storage type. You can get the Add New Datasource screen shown below on the management console by executing steps 1 to 3 in creating a data service. Then, select Cassandra as the Datasource Type. It opens the Cassandra-specific options as shown below:
In the above screen, provide the URL and credentials to connect to your Cassandra keyspace.
INFO: Given below are basic sample Cassandra CLI commands to create and edit a keyspace:
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';
The Cassandra-JDBC-1.1.1 server
feature (whose identifier is org.wso2.carbon.cassandra-jdbc-1.1.1.server.feature.group
) in WSO2 Data Services Server provides support to expose data from a Cassandra versions 1.1.0 or later, as a service. If you use a Cassandra server version older than 1.1.0, uninstall the above feature and install the cassandra-jdbc-1.0.5
feature according to Installing and Managing Features.
To write a query to the datasource created here, see Sample 2: Adding output mappings to a query or read everything you need to know about query writing in Writing Data Service Queries.