Return-Path: X-Original-To: apmail-camel-commits-archive@www.apache.org Delivered-To: apmail-camel-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 6D2C7CF7F for ; Wed, 7 Jan 2015 22:19:39 +0000 (UTC) Received: (qmail 40813 invoked by uid 500); 7 Jan 2015 22:19:40 -0000 Delivered-To: apmail-camel-commits-archive@camel.apache.org Received: (qmail 40762 invoked by uid 500); 7 Jan 2015 22:19:40 -0000 Mailing-List: contact commits-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@camel.apache.org Delivered-To: mailing list commits@camel.apache.org Received: (qmail 40753 invoked by uid 99); 7 Jan 2015 22:19:40 -0000 Received: from eris.apache.org (HELO hades.apache.org) (140.211.11.105) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 07 Jan 2015 22:19:40 +0000 Received: from hades.apache.org (localhost [127.0.0.1]) by hades.apache.org (ASF Mail Server at hades.apache.org) with ESMTP id 76077AC094F for ; Wed, 7 Jan 2015 22:19:40 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r935421 - in /websites/production/camel/content: cache/main.pageCache cassandra.html Date: Wed, 07 Jan 2015 22:19:40 -0000 To: commits@camel.apache.org From: buildbot@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20150107221940.76077AC094F@hades.apache.org> Author: buildbot Date: Wed Jan 7 22:19:40 2015 New Revision: 935421 Log: Production update by buildbot for camel Modified: websites/production/camel/content/cache/main.pageCache websites/production/camel/content/cassandra.html Modified: websites/production/camel/content/cache/main.pageCache ============================================================================== Binary files - no diff available. Modified: websites/production/camel/content/cassandra.html ============================================================================== --- websites/production/camel/content/cassandra.html (original) +++ websites/production/camel/content/cassandra.html Wed Jan 7 22:19:40 2015 @@ -85,28 +85,30 @@ -

 

Camel Cassandra Component

Available as of Camel 2.15

Apache Cassandra is an open source NoSQL database designed to handle large amounts on commodity hardware. Like Amazon's DynamoDB, Cassandra has a peer-to-peer and master-less architecture to avoid single point of failure and garanty high availability. Like Google's BigTable, Cassandra data is structured using column families which can be accessed through the Thrift RPC API or a SQL-like API called CQL.

This component aims at integrating Cassandra 2.0+ using the CQL3 API (not the Thrift API). It's based on Cassandra Java Driver provided by DataStax.

Maven users will need to add the following dependency to their pom.xml for this component:

pom.xml
+

 

Camel Cassandra Component

Available as of Camel 2.15

Apache Cassandra is an open source NoSQL database designed to handle large amounts on commodity hardware. Like Amazon's DynamoDB, Cassandra has a peer-to-peer and master-less architecture to avoid single point of failure and garanty high availability. Like Google's BigTable, Cassandra data is structured using column families which can be accessed through the Thrift RPC API or a SQL-like API called CQL.

This component aims at integrating Cassandra 2.0+ using the CQL3 API (not the Thrift API). It's based on Cassandra Java Driver provided by DataStax.

Maven users will need to add the following dependency to their pom .xml:

pom.xml
-

URI format

The endpoint can initiate the Cassandra connection or use an existing one.

URIDescription
cql:localhost/keyspaceSingle host, default port, usual for testing
cql:host1,host2/keyspaceMulti host, default port
cql:host1,host2:9042/keyspaceMulti host, custom port
cql:host1,host2Default port and keyspace
cql:bean:sessionRefProvided Session reference
cql:bean:clusterRef/keyspaceProvided Cluster reference

To fine tune the Cassandra connection (SSL options, pooling options, load balancing policy, retry policy, reconnection policy...), create your own Cluster instance and give it to the Camel endpoint.

Endpoint Options

OptionDescription

clusterName

Cluster name

username and password

Session authentication

cql

CQL query. Can be overriden with a message header.

consistencyLevel

ANY, ONE, TWO, QUORUM, LOCAL_QUORUM...

resultSetConversionStrategy

How is ResultSet converted transformed into message body ALL, ONE, LIMIT_10, LIMIT_100...

Incoming Message

The Camel Cassandra endpoint expects a bunch of simple objects (Object[] or Collection<Object>) which will be bound to the CQL statement as query parameters.

Headers:

  • CamelCqlQuery (optional, String): CQL query

Outgoing Message

The Camel Cassandra endpoint produces one or many a Cassandra Row objects depending on the resultSetConversionStrategy:

 

  • List<Row> if resultSetConversionStrategy is ALL or LIMIT_10
  • Single Row if resultSetConversionStrategy is ONE
  • Anything else, if resultSetConversionStrategy is a custom implementation of the ResultSetConversionStrategy

Repositories

Cassandra can be used to store messages or messages for the id empotent and aggregation EIP.

Cassandra might not be the best tool for queuing use cases yet, read Cassandra anti-patterns queues and queue like datasets. It's advised to use LeveledCompaction and a small GC grace setting for these tables to allow tombstoned rows to be removed quickly.

Idempotent repository

The NamedCassandraIdempotentRepository stores messages keys in a Cassandra table like this:

CAMEL_IDEMPOTENT.cql
+

URI format

The endpoint can initiate the Cassandra connection or use an existing one.

URIDescription
cql:localhost/keyspaceSingle host, default port, usual for testing
cql:host1,host2/keyspaceMulti host, default port
cql:host1,host2:9042/keyspaceMulti host, custom port
cql:host1,host2Default port and keyspace
cql:bean:sessionRefProvided Session reference
cql:bean:clusterRef/keyspaceProvided Cluster reference

To fine tune the Cassandra connection (SSL options, pooling options, load balancing policy, retry policy, reconnection policy...), create your own Cluster instance and give it to the Camel endpoint.

Endpoint Options

OptionDefaultDescription

clusterName

 

Cluster name

username and password

 

Session authentication

cql

 

CQL query. Can be overriden with a message header.

consistencyLevel

 

ANY, ONE, TWO, QUORUM, L OCAL_QUORUM...

resultSetConversionStrategy

ALL

How is ResultSet converted transformed into message body ALL, ONE, LIMIT_10, LIMIT_100...

Messages

Incoming Message

The Camel Cassandra endpoint expects a bunch of simple objects (Object[] or Collection<Object>) which will be bound to the CQL statement as query parameters.

Headers:

  • CamelCqlQuery (optional, String): CQL query

Outgoing Message

The Camel Cassandra endpoint produces one or many a Cassandra Row objects depending on the resultSetConversionStrategy:

 < /p>

  • List<Row> if resultSetConversionStrategy is ALL or LIMIT_10
  • Single Row if resultSetConversionStrategy is ONE
  • Anything else, if resultSetConversionStrategy is a custom implementation of the ResultSetConversionStrategy

Repositories

Cassandra can be used to store messages or messages for the idempotent and aggregation EIP.

Cassandra might not be the best tool for queuing use cases yet, read Cassandra anti-patterns queues and queue like datasets. It's advised to use LeveledCompaction and a small GC grace setting for these tables to allow tombstoned rows to be removed quickly.

Idempotent repository

The NamedCassandraIdempotentRepository stores messages keys in a Cassandra table like this:

CAMEL_IDEMPOTENT.cql
-

The CassandraIdempotentRepository can be extended to use a different data model.

Aggregation repository

The name NamedCassandraAggregationRepository stores messages by correlation key in a Cassandra table like this:

CAMEL_AGGREGATION.cql
+) WITH compaction = {'class':'LeveledCompactionStrategy'} + AND gc_grace_seconds = 86400;]]> +

This repository implementation uses lightweight transactions (also known as Compare and Set) and requires Cassandra 2.0.7+.

The CassandraIdempotentRepository can be extended to use a different data model.

OptionDefaultDescription
tableCAMEL_IDEMPOTENTTable name
pkColumnsNAME, KEYPrimary key columns
name Repository name, value used for NAME column
ttl Key time to live
writeConsistencyLevel Consistency level used to insert/delete key: ANY, ONE, TWO, QUORUM, LOCAL_QUORUM
readConsistencyLevel Consistency level used to read/check key: ONE, TWO, QUORUM, LOCAL_QUORUM

Aggregation repository

The NamedCassandraAggregationRepository stores exchanges by correlation key in a Cassandra table like this:

CAMEL_AGGREGATION.cql
-

The CassandraAggregationRepository can be extended to use a different data model.

+) WITH compaction = {'class':'LeveledCompactionStrategy'} + AND gc_grace_seconds = 86400;]]> +

The CassandraAggregationRepository can be extended to use a different data model.

OptionDefaultDescription
tableCAMEL_AGGREGATIONTable name
pkColumnsNAME,KEYPrimary key columns
exchangeIdColumnEXCHANGE_ID Exchange Id column
exchangeColumnEXCHANGEExchange content column
name Repository name, value used for NAME column
ttl Exchange time to live
writeConsistencyLevel Consistency l evel used to insert/delete exchange: ANY, ONE, TWO, QUORUM, LOCAL_QUORUM
readConsistencyLevel Consistency level used to read/check exchange: ONE, TWO, QUORUM, LOCAL_QUORUM