The latest version for DAS is WSO2 Data Analytics Server 3.1.0. View documentation for the latest release.
WSO2 Data Analytics Server is succeeded by WSO2 Stream Processor. To view the latest documentation for WSO2 SP, see WSO2 Stream Processor Documentation.

All docs This doc
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 
||
Skip to end of metadata
Go to start of metadata

Introduction

This sample demonstrates how to publish incoming events to Apache Cassandra using the Cassandra event publisher of DAS. This sample does not do any processing on the incoming event. Use the pre-packaged Cassandra-CLI tool of Apache Cassandra, to verify if the messages are properly published.

Prerequisites

Set up the prerequisites required for all samples.

Building the sample 

Start the WSO2 DAS server with the sample configuration numbered 0067. For instructions, see Starting sample CEP configurations. This sample configuration does the following:

  • Changes the default Axis2 repo from  <DAS_HOME>/repository/deployment/server to <DAS_HOME>/samples/cep/artifacts/0067.
  • Creates an event stream named org.wso2.event.transaction.stream:1.0.0.
  • Loads the events.csv file and related configuration files so that the Event Simulator can be used to send events to the pre-configured event publisher.
  • Creates an event publisher named cassandra to send the received messages to a Cassandra cluster. This event publisher publishes events in Map (key,value pair) event format.

Executing the sample

  1. Setup a Apache Cassandra cluster. The sample is configured to send events to Cassandra cluster that is configured to listen on localhost:9160 port. (If the Cassandra cluster is running on a different node, please change the event publisher configuration as necessary). The Cassandra event publisher needs the following configurations to be valid in the Cassandra cluster.

    • Cluster Name: Test Cluster
    • Keyspace: CEP_KS
    • Column Family: CF_Transactions (Comparator should be of type 'UTF8Type' or 'AsciiType')
    • Connection Username: admin
    • Connection Password: admin
    You can use the Cassandra CLI client that is packaged with Apache Cassandra to create the keyspace and column family as necessary. The following CLI commands have been tested with Apache Cassandra v1.2.19
    • Create a keyspace: create keyspace DAS_KS;
    • Use keyspace: use DAS_KS admin 'admin';
    • Create column family: create column family CF_Transactions with comparator = 'UTF8Type' and caching='ALL';

    creating an event publisher

  2. Log into the DAS Management Console. In the Tools tab, click Event Simulator to open the Event Simulator page. In the Event Stream Name field, select org.wso2.event.transaction.stream:1.0.0. In the Send multiple events section, click Play for the event.csv file to play the events.  
  3. You can see the events getting received by DAS by executing the command 'list CF_Transactions;' in Cassandra CLI.

  • No labels