The Apache Cassandra database is the right choice when you need scalability and high availability without compromising performance. Cassandra's ColumnFamily data model offers the convenience of column indexes with the performance of log-structured updates, strong support for materialized views, and powerful built-in caching.

Additional Info

Requires Mule Enterprise License

Yes  

Requires Entitlement

No  

Mule Version

3.6.0 or higher

Configs


Configuration

<cassandradb:config>

Connection Management

Attributes

Name Java Type Description Default Value Required

name

String

The name of this configuration. With this name can be later referenced.

x 

username

String

A username. NOTE: Please use a dummy username if you have disabled authentication

 

password

String

A password. NOTE: Leave empty if not required. If specified, the connector will try to login with this credentials

 

host

String

Host name or IP address

 

port

String

Port

 

keyspace

String

Cassandra keyspace

 

clusterName

String

Cassandra cluster name

 

clusterNodes

String

Cassandra cluster nodes(ip or host address and port separated by comma. E.g: host1:port1, host2:port2). If the port is not specified, the default 9042 will be used. When you specify this parameter, the host and port from general settings will be ignored.

 

protocolVersion

ProtocolVersion

Version of the native protocol supported by the driver.

 

loadBalancingPolicy

LoadBalancingPolicyEnum

Load balancing policy to be used when connecting to a cluster

 

maxSchemaAgreementWaitSeconds

int

The maximum time to wait for schema agreement before returning from a DDL query.

 

compression

Compression

The compression to use for the transport.

 

sslEnabled

boolean

Enables the use of SSL for the cluster.

false

 

Processors


Create keyspace

<cassandradb:create-keyspace>

Creates a new keyspace

Attributes

Name Java Type Description Default Value Required

config-ref

String

Specify which config to use

x 

input

CreateKeyspaceInput

operation input containing the keyspace name and the replication details

#[payload]

 

Returns

Return Java Type Description

boolean

true if the operation succeeded, false otherwise


Drop keyspace

<cassandradb:drop-keyspace>

Drops the entire keyspace

Attributes

Name Java Type Description Default Value Required

config-ref

String

Specify which config to use

x 

keyspaceName

String

the name of the keyspace to be dropped

x 

Returns

Return Java Type Description

boolean

true if the operation succeeded, false otherwise


Create table

<cassandradb:create-table>

Creates a table(column family) in a specific keyspace; If no keyspace is specified the keyspace used for login will be used

Attributes

Name Java Type Description Default Value Required

config-ref

String

Specify which config to use

x 

input

CreateTableInput

operation input describing the table name, the keyspace name and the list of columns

#[payload]

 

Returns

Return Java Type Description

boolean

true if the operation succeeded, false otherwise


Drop table

<cassandradb:drop-table>

Drops an entire table form the specified keyspace or from the keyspace used for login if none is specified as an operation parameter

Attributes

Name Java Type Description Default Value Required

config-ref

String

Specify which config to use

x 

tableName

String

the name of the table to be dropped

x 

keyspaceName

String

(optional) the keyspace which contains the table to be dropped

 

Returns

Return Java Type Description

boolean

true if the operation succeeded, false otherwise


Execute CQL Query

<cassandradb:execute-c-q-l-query>

Executes the raw input query provided

Attributes

Name Java Type Description Default Value Required

config-ref

String

Specify which config to use

x 

input

CQLQueryInput

CQLQueryInput describing the parametrized query to be executed along with the parameters

#[payload]

 

Returns

Return Java Type Description

List<Map<String,Object>>

the result of the query execution


Insert

<cassandradb:insert>

  DataSense enabled

Executes the insert entity operation

XML Sample

<cassandradb:insert rowKey="1" columnParent="UserData" columnName="password" columnValue="mypassword"/>

Attributes

Name Java Type Description Default Value Required

config-ref

String

Specify which config to use

x 

table

String

the table name in which the entity will be inserted

x 

keyspaceName

String

(optional) the keyspace which contains the table to be used

 

entity

Map<String,Object>

the entity to be inserted

#[payload]

 


Update

<cassandradb:update>

  DataSense enabled

Executes the update entity operation

Attributes

Name Java Type Description Default Value Required

config-ref

String

Specify which config to use

x 

table

String

the table name in which the entity will be updated

x 

keyspaceName

String

(optional) the keyspace which contains the table to be dropped

 

entity

Map<String,Object>

the entity to be updated

#[payload]

 


Delete columns value

<cassandradb:delete-columns-value>

  DataSense enabled

Deletes values from an object specified by the where clause

Attributes

Name Java Type Description Default Value Required

config-ref

String

Specify which config to use

x 

table

String

the name of the table

x 

keyspaceName

String

(optional) the keyspace which contains the table to be used

 

payload

Map<String,Object>

operation input: columns to be deleted and where clause for the delete operation

#[payload]

 


Delete rows

<cassandradb:delete-rows>

  DataSense enabled

Deletes an entire record

Attributes

Name Java Type Description Default Value Required

config-ref

String

Specify which config to use

x 

table

String

the name of the table

x 

keyspaceName

String

(optional) the keyspace which contains the table to be used

 

payload

Map<String,Object>

operation input: where clause for the delete operation

#[payload]

 


Select

<cassandradb:select>

Executes a select query

Attributes

Name Java Type Description Default Value Required

config-ref

String

Specify which config to use

x 

query

String

the query to be executed

#[payload]

 

parameters

List<Object>

the query parameters

 

Returns

Return Java Type Description

List<Map<String,Object>>

list of entities returned by the select query


Get table names from keyspace

<cassandradb:get-table-names-from-keyspace>

Returns all the table names from the specified keyspace

Attributes

Name Java Type Description Default Value Required

config-ref

String

Specify which config to use

x 

keyspaceName

String

the name of the keyspace to be used on the operation

 

Returns

Return Java Type Description

List<String>

a list of table names


Change the type of a column

<cassandradb:change-column-type>

Changes the type of a column - check compatibility here: CQL type compatibility

Attributes

Name Java Type Description Default Value Required

config-ref

String

Specify which config to use

x 

table

String

the name of the table to be used for the operation

x 

keyspaceName

String

(optional) the keyspace which contains the table to be used

 

input

AlterColumnInput

POJO defining the name of the column to be changed and the new DataType

#[payload]

 

Returns

Return Java Type Description

boolean

true if the operation succeeded or false if not


Add new column

<cassandradb:add-new-column>

Adds a new column

Attributes

Name Java Type Description Default Value Required

config-ref

String

Specify which config to use

x 

table

String

the name of the table to be used for the operation

x 

keyspaceName

String

(optional) the keyspace which contains the table to be used

 

input

AlterColumnInput

POJO defining the name of the new column and its DataType

#[payload]

 

Returns

Return Java Type Description

boolean

true if the operation succeeded or false if not


Remove column

<cassandradb:drop-column>

Removes a column

Attributes

Name Java Type Description Default Value Required

config-ref

String

Specify which config to use

x 

table

String

the name of the table to be used for the operation

x 

keyspaceName

String

(optional) the keyspace which contains the table to be used

 

columnName

String

the name of the column to be removed

#[payload]

 

Returns

Return Java Type Description

boolean

true if the operation succeeded or false if not


Rename column

<cassandradb:rename-column>

Renames a column

Attributes

Name Java Type Description Default Value Required

config-ref

String

Specify which config to use

x 

table

String

the name of the table to be used for the operation

x 

keyspaceName

String

(optional) the keyspace which contains the table to be used

 

oldColumnName

String

the name of the column to be changed

#[payload]

 

newColumnName

String

the new value for the name of the column

x 

Returns

Return Java Type Description

boolean

true if the operation succeeded or false if not