Introduction
This sample demonstrated the use of the Cassandra data source functionality in WSO2 DSS to connect to a Cassandra cluster.
Building the sample
The sample data service CassandraSample should be deployed using the instructions in Deploying Data Services section.
Prerequisites
A Cassandra server v1.2.x or v.2.0 should be already running in the default port. Cassandra v2.0 recommended, where the native batch requests are only supported in this version.
Running the sample
The sample can be run using any SOAP client such as the "Try-It" tool that comes bundles with WSO2 DSS.
Service description
The service contains the following operations:
- "createKS": This creates the Cassandra keyspace required for the sample. This must be first called once before running other operations.
- "createTable": This creates a Cassandra CQL3 table required for the sample. This must be calls once after "createKS" is called.
- "addUser": This operation takes in user details and add it to Cassandra, here "id" is the primary key and it takes in an UUID as the value.
- "addUser_batch_req": This is the corresponding batch request of "addUser", where it takes in a batch of "addUser" data entries and adds it as a single batch operation.
- "getUserById": This operations returns the user information given the id of a specific user.
- "getUsers": This operation returns information of all the users stored in the Cassandra store.