Accessing external Cassandra using DevCenter tool

Accessing external Cassandra using DevCenter tool

Once WSO2 BAM is integrated with an external Cassandra such as apache-cassandra-2.0.9 we can use the DevCenter tool from Datastax to access the keyspaces.

For this post I will use the wso2 Business Activity Monitor 250,  apache-cassandra-2.0.9 and DevCenter 1.2.1

In my scenario, I have a http input adaptor and an http event builder with a  topic specified. Also for my scenario, I have generated events to be stored in Cassandra using the curl command as  curl -v -X POST -H "Content-Type:application/xml"  -d@payload.xml "http://localhost:9763/endpoints/http_input/topicx"

Now, I want to use an external tool to access the events stored in cassandra under EVENT_KS for the stream http_stream.

The first task should be to update the cassandra.yaml file within [BAM-HOME]/repository/conf/etc folder as below. As the below configurations show the change made was to set start_native_transport to true

# Leaving it blank leaves it up to InetAddress.getLocalHost(). This
# will always do the Right Thing _if_ the node is properly configured
# (hostname, name resolution, etc), and the Right Thing is to use the
# address associated with the hostname (it might not be).
#
# Setting this to 0.0.0.0 is always wrong.
listen_address: localhost

# Address to broadcast to other Cassandra nodes
# Leaving this blank will set it to the same value as listen_address
# broadcast_address: 1.2.3.4

# Internode authentication backend, implementing IInternodeAuthenticator;
# used to allow/disallow connections from peer nodes.
# internode_authenticator: org.apache.cassandra.auth.AllowAllInternodeAuthenticator

# Whether to start the native transport server.
# Please note that the address on which the native transport is bound is the
# same as the rpc_address. The port however is different and specified below.
start_native_transport: true

# port for the CQL native transport to listen for clients on
native_transport_port: 9042


Next, once the DevCenter tool is started as shown below we need to set the connection details.Once we click on the option create  new connection, we enter the IP address and then click on "add" button. We don’t make any changes to the native protocol port at that matches with the native_transport_port specified within the cassandra.yaml.








Next, as shown below from the dropdown menu select the connection name and key-spaces and write the relevant sql queiry to view all the events that were saved within the cassandra.

For my example I will select connection name as "connection1" and EVENT_KS as the key space name. Once these are selected, I enter the sql as select * from http_stream. to view the details.


Comments