camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From build...@apache.org
Subject svn commit: r935421 - in /websites/production/camel/content: cache/main.pageCache cassandra.html
Date Wed, 07 Jan 2015 22:19:40 GMT
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 @@
 	<tbody>
         <tr>
         <td valign="top" width="100%">
-<div class="wiki-content maincontent"><p>&#160;</p><h1 id="Cassandra-CamelCassandraComponent">Camel
Cassandra Component</h1><p><strong>Available as of Camel 2.15</strong></p><p>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.</p><p>This component aims at integrating Cassandra 2.0+
using the CQL3 API (not the Thrift API). It's based on <a shape="rect" class="external-link"
href="https://github.com/datastax/java-driver" rel="nofollow">Cassandra Java Driver</a>
provided by DataStax.</p><p>Maven users will need to add the following dependency
to their <code>pom.xml</code> for this component:</p><div class="code
panel pdl" style="border-
 width: 1px;"><div class="codeHeader panelHeader pdl" style="border-bottom-width: 1px;"><b>pom.xml</b></div><div
class="codeContent panelContent pdl">
+<div class="wiki-content maincontent"><p>&#160;</p><h1 id="Cassandra-CamelCassandraComponent">Camel
Cassandra Component</h1><p><strong>Available as of Camel 2.15</strong></p><p><a
shape="rect" class="external-link" href="http://cassandra.apache.org">Apache Cassandra</a>
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.</p><p>This component aims at integrating Cassandra 2.0+ using
the CQL3 API (not the Thrift API). It's based on <a shape="rect" class="external-link"
href="https://github.com/datastax/java-driver" rel="nofollow">Cassandra Java Driver</a>
provided by DataStax.</p><p>Maven users will need to add the following dependency
to their <code>pom
 .xml</code>:</p><div class="code panel pdl" style="border-width: 1px;"><div
class="codeHeader panelHeader pdl" style="border-bottom-width: 1px;"><b>pom.xml</b></div><div
class="codeContent panelContent pdl">
 <script class="theme: Default; brush: xml; gutter: false" type="syntaxhighlighter"><![CDATA[&lt;dependency&gt;
     &lt;groupId&gt;org.apache.camel&lt;/groupId&gt;
     &lt;artifactId&gt;camel-cassandraql&lt;/artifactId&gt;
     &lt;version&gt;x.y.z&lt;/version&gt;
     &lt;!-- use the same version as your Camel core version --&gt;
 &lt;/dependency&gt;]]></script>
-</div></div><h2 id="Cassandra-URIformat">URI format</h2><p>The
endpoint can initiate the Cassandra connection or use an existing one.</p><div class="table-wrap"><table
class="confluenceTable"><thead><tr><th colspan="1" rowspan="1" class="confluenceTh">URI</th><th
colspan="1" rowspan="1" class="confluenceTh">Description</th></tr></thead><tbody><tr><td
colspan="1" rowspan="1" class="confluenceTd"><code>cql:localhost/keyspace</code></td><td
colspan="1" rowspan="1" class="confluenceTd">Single host, default port, usual for testing</td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd"><code>cql:host1,host2/keyspace</code></td><td
colspan="1" rowspan="1" class="confluenceTd">Multi host, default port</td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd"><code>cql:host1,host2:9042/keyspace</code></td><td
colspan="1" rowspan="1" class="confluenceTd">Multi host, custom port</td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd"><code>cql:host1,host2</code></td><td
colspa
 n="1" rowspan="1" class="confluenceTd">Default port and keyspace</td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd"><code>cql:bean:sessionRef</code></td><td
colspan="1" rowspan="1" class="confluenceTd">Provided Session reference</td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd"><code>cql:bean:clusterRef/keyspace</code></td><td
colspan="1" rowspan="1" class="confluenceTd">Provided Cluster reference</td></tr></tbody></table></div><p>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.</p><h2 id="Cassandra-EndpointOptions">Endpoint Options</h2><div
class="table-wrap"><table class="confluenceTable"><thead><tr><th colspan="1"
rowspan="1" class="confluenceTh">Option</th><th colspan="1" rowspan="1" class="confluenceTh">Description</th></tr></thead><tbody><tr><td
colspan="1" rowspan="1" class="confluenceTd"><p>clusterName</p
 ></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Cluster name</p></td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd"><p><code>username and password</code></p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p>Session authentication</p></td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd"><p><code>cql</code></p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p>CQL query. Can be overriden with
a message header.</p></td></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd"><p><code>consistencyLevel</code></p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p><code>ANY</code>, <code>ONE</code>,
<code>TWO</code>, <code>QUORUM</code>, <code>LOCAL_QUORUM</code>...</p></td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd"><p><code>resultSetConversionStrategy</code></p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p>How is ResultSet converted transformed
into message body <code>ALL</code>, <code>ONE</code>, <code>LIMIT_10</
 code>, <code>LIMIT_100</code>...</p></td></tr></tbody></table></div><h2
id="Cassandra-IncomingMessage">Incoming Message</h2><p>The Camel Cassandra
endpoint expects a bunch of simple objects (Object[] or Collection&lt;Object&gt;)
which will be bound to the CQL statement as query parameters.</p><p>Headers:</p><ul
class="task-list"><li><code>CamelCqlQuery</code> (optional, String):
CQL query</li></ul><h2 id="Cassandra-OutgoingMessage">Outgoing Message</h2><p>The
Camel Cassandra endpoint produces one or many a Cassandra Row objects depending on the&#160;resultSetConversionStrategy:</p><p>&#160;</p><ul><li><code>List&lt;Row&gt;</code>
if resultSetConversionStrategy is ALL or LIMIT_10</li><li><code>Single Row</code>
if resultSetConversionStrategy is ONE</li><li>Anything else, if resultSetConversionStrategy
is a custom implementation of the ResultSetConversionStrategy</li></ul><h2
id="Cassandra-Repositories">Repositories</h2><p>Cassandra can be used to store
messages or messages for the id
 empotent and aggregation EIP.</p><p>Cassandra might not be the best tool for
queuing use cases yet, read <a shape="rect" class="external-link" href="http://www.datastax.com/dev/blog/cassandra-anti-patterns-queues-and-queue-like-datasets"
rel="nofollow">Cassandra anti-patterns queues and queue like datasets</a>. It's advised
to use LeveledCompaction and a small GC grace setting for these tables to allow tombstoned
rows to be removed quickly.</p><h3 id="Cassandra-Idempotentrepository">Idempotent
repository</h3><p>The NamedCassandraIdempotentRepository stores messages keys
in a Cassandra table like this:</p><div class="code panel pdl" style="border-width:
1px;"><div class="codeHeader panelHeader pdl" style="border-bottom-width: 1px;"><b>CAMEL_IDEMPOTENT.cql</b></div><div
class="codeContent panelContent pdl">
+</div></div><h2 id="Cassandra-URIformat">URI format</h2><p>The
endpoint can initiate the Cassandra connection or use an existing one.</p><div class="table-wrap"><table
class="confluenceTable"><thead><tr><th colspan="1" rowspan="1" class="confluenceTh">URI</th><th
colspan="1" rowspan="1" class="confluenceTh">Description</th></tr></thead><tbody><tr><td
colspan="1" rowspan="1" class="confluenceTd"><code>cql:localhost/keyspace</code></td><td
colspan="1" rowspan="1" class="confluenceTd">Single host, default port, usual for testing</td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd"><code>cql:host1,host2/keyspace</code></td><td
colspan="1" rowspan="1" class="confluenceTd">Multi host, default port</td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd"><code>cql:host1,host2:9042/keyspace</code></td><td
colspan="1" rowspan="1" class="confluenceTd">Multi host, custom port</td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd"><code>cql:host1,host2</code></td><td
colspa
 n="1" rowspan="1" class="confluenceTd">Default port and keyspace</td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd"><code>cql:bean:sessionRef</code></td><td
colspan="1" rowspan="1" class="confluenceTd">Provided Session reference</td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd"><code>cql:bean:clusterRef/keyspace</code></td><td
colspan="1" rowspan="1" class="confluenceTd">Provided Cluster reference</td></tr></tbody></table></div><p>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.</p><h2 id="Cassandra-EndpointOptions">Endpoint Options</h2><div
class="table-wrap"><table class="confluenceTable"><thead><tr><th colspan="1"
rowspan="1" class="confluenceTh">Option</th><th colspan="1" rowspan="1" class="confluenceTh">Default</th><th
colspan="1" rowspan="1" class="confluenceTh">Description</th></tr></thead><tbody><tr><td
c
 olspan="1" rowspan="1" class="confluenceTd"><p>clusterName</p></td><td
colspan="1" rowspan="1" class="confluenceTd">&#160;</td><td colspan="1" rowspan="1"
class="confluenceTd"><p>Cluster name</p></td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd"><p><code>username and password</code></p></td><td
colspan="1" rowspan="1" class="confluenceTd">&#160;</td><td colspan="1" rowspan="1"
class="confluenceTd"><p>Session authentication</p></td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd"><p><code>cql</code></p></td><td
colspan="1" rowspan="1" class="confluenceTd">&#160;</td><td colspan="1" rowspan="1"
class="confluenceTd"><p>CQL query. Can be overriden with a message header.</p></td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd"><p><code>consistencyLevel</code></p></td><td
colspan="1" rowspan="1" class="confluenceTd">&#160;</td><td colspan="1" rowspan="1"
class="confluenceTd"><p><code>ANY</code>, <code>ONE</code>,
<code>TWO</code>, <code>QUORUM</code>, <code>L
 OCAL_QUORUM</code>...</p></td></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd"><p><code>resultSetConversionStrategy</code></p></td><td
colspan="1" rowspan="1" class="confluenceTd">ALL</td><td colspan="1" rowspan="1"
class="confluenceTd"><p>How is ResultSet converted transformed into message body
<code>ALL</code>, <code>ONE</code>, <code>LIMIT_10</code>,
<code>LIMIT_100</code>...</p></td></tr></tbody></table></div><h2
id="Cassandra-Messages">Messages</h2><h3 id="Cassandra-IncomingMessage">Incoming
Message</h3><p>The Camel Cassandra endpoint expects a bunch of simple objects
(Object[] or Collection&lt;Object&gt;) which will be bound to the CQL statement as
query parameters.</p><p>Headers:</p><ul class="task-list"><li><code>CamelCqlQuery</code>
(optional, String): CQL query</li></ul><h3 id="Cassandra-OutgoingMessage">Outgoing
Message</h3><p>The Camel Cassandra endpoint produces one or many a Cassandra Row
objects depending on the&#160;resultSetConversionStrategy:</p><p>&#160;<
 /p><ul><li><code>List&lt;Row&gt;</code> if resultSetConversionStrategy
is ALL or LIMIT_10</li><li><code>Single Row</code> if resultSetConversionStrategy
is ONE</li><li>Anything else, if resultSetConversionStrategy is a custom implementation
of the ResultSetConversionStrategy</li></ul><h2 id="Cassandra-Repositories">Repositories</h2><p>Cassandra
can be used to store messages or messages for the idempotent and aggregation EIP.</p><p>Cassandra
might not be the best tool for queuing use cases yet, read <a shape="rect" class="external-link"
href="http://www.datastax.com/dev/blog/cassandra-anti-patterns-queues-and-queue-like-datasets"
rel="nofollow">Cassandra anti-patterns queues and queue like datasets</a>. It's advised
to use LeveledCompaction and a small GC grace setting for these tables to allow tombstoned
rows to be removed quickly.</p><h3 id="Cassandra-Idempotentrepository">Idempotent
repository</h3><p>The NamedCassandraIdempotentRepository stores messages keys
in a Cassandra table 
 like this:</p><div class="code panel pdl" style="border-width: 1px;"><div
class="codeHeader panelHeader pdl" style="border-bottom-width: 1px;"><b>CAMEL_IDEMPOTENT.cql</b></div><div
class="codeContent panelContent pdl">
 <script class="theme: Default; brush: sql; gutter: false" type="syntaxhighlighter"><![CDATA[CREATE
TABLE CAMEL_IDEMPOTENT (
   NAME varchar,   -- Repository name
   KEY varchar,    -- Message key
   PRIMARY KEY (NAME, KEY)
-);]]></script>
-</div></div><p>The CassandraIdempotentRepository can be extended to use
a different data model.</p><h3 id="Cassandra-Aggregationrepository">Aggregation
repository</h3><p>The name NamedCassandraAggregationRepository stores messages
by correlation key in a Cassandra table like this:</p><div class="code panel pdl"
style="border-width: 1px;"><div class="codeHeader panelHeader pdl" style="border-bottom-width:
1px;"><b>CAMEL_AGGREGATION.cql</b></div><div class="codeContent panelContent
pdl">
+) WITH compaction = {&#39;class&#39;:&#39;LeveledCompactionStrategy&#39;}
+  AND gc_grace_seconds = 86400;]]></script>
+</div></div><p>This repository implementation uses lightweight transactions
(also known as Compare and Set) and requires Cassandra 2.0.7+.</p><p>The CassandraIdempotentRepository
can be extended to use a different data model.</p><div class="table-wrap"><table
class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1" class="confluenceTh">Option</th><th
colspan="1" rowspan="1" class="confluenceTh">Default</th><th colspan="1" rowspan="1"
class="confluenceTh">Description</th></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd"><code>table</code></td><td colspan="1" rowspan="1"
class="confluenceTd"><code>CAMEL_IDEMPOTENT</code></td><td colspan="1"
rowspan="1" class="confluenceTd">Table name</td></tr><tr><td colspan="1"
rowspan="1" class="confluenceTd"><code>pkColumns</code></td><td colspan="1"
rowspan="1" class="confluenceTd"><code>NAME</code>,<code> KEY</code></td><td
colspan="1" rowspan="1" class="confluenceTd">Primary key columns</td></tr><tr><td
colspan="1" rowspan="1" clas
 s="confluenceTd"><code>name</code></td><td colspan="1" rowspan="1"
class="confluenceTd">&#160;</td><td colspan="1" rowspan="1" class="confluenceTd">Repository
name, value used for <code>NAME</code> column</td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd"><code>ttl</code></td><td
colspan="1" rowspan="1" class="confluenceTd">&#160;</td><td colspan="1" rowspan="1"
class="confluenceTd">Key time to live</td></tr><tr><td colspan="1"
rowspan="1" class="confluenceTd"><code>writeConsistencyLevel</code></td><td
colspan="1" rowspan="1" class="confluenceTd">&#160;</td><td colspan="1" rowspan="1"
class="confluenceTd">Consistency level used to insert/delete key: <code>ANY</code>,
<code>ONE</code>, <code>TWO</code>, <code>QUORUM</code>,
<code>LOCAL_QUORUM</code>&#8230;</td></tr><tr><td colspan="1"
rowspan="1" class="confluenceTd"><code>readConsistencyLevel</code></td><td
colspan="1" rowspan="1" class="confluenceTd">&#160;</td><td colspan="1" rowspan="1"
class="confluenceTd">Consistency
  level used to read/check key: <code>ONE</code>, <code>TWO</code>,
<code>QUORUM</code>, <code>LOCAL_QUORUM</code>&#8230;</td></tr></tbody></table></div><h3
id="Cassandra-Aggregationrepository">Aggregation repository</h3><p>The NamedCassandraAggregationRepository
stores exchanges by correlation key in a Cassandra table like this:</p><div class="code
panel pdl" style="border-width: 1px;"><div class="codeHeader panelHeader pdl" style="border-bottom-width:
1px;"><b>CAMEL_AGGREGATION.cql</b></div><div class="codeContent panelContent
pdl">
 <script class="theme: Default; brush: sql; gutter: false" type="syntaxhighlighter"><![CDATA[CREATE
TABLE CAMEL_AGGREGATION (
   NAME varchar,        -- Repository name
   KEY varchar,         -- Correlation id
   EXCHANGE_ID varchar, -- Exchange id
   EXCHANGE blob,       -- Serialized exchange
   PRIMARY KEY (NAME, KEY)
-);]]></script>
-</div></div><p>The CassandraAggregationRepository can be extended to use
a different data model.</p></div>
+) WITH compaction = {&#39;class&#39;:&#39;LeveledCompactionStrategy&#39;}
+  AND gc_grace_seconds = 86400;]]></script>
+</div></div><p>The CassandraAggregationRepository can be extended to use
a different data model.</p><div class="table-wrap"><table class="confluenceTable"><tbody><tr><th
colspan="1" rowspan="1" class="confluenceTh">Option</th><th colspan="1" rowspan="1"
class="confluenceTh">Default</th><th colspan="1" rowspan="1" class="confluenceTh">Description</th></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd"><code>table</code></td><td
colspan="1" rowspan="1" class="confluenceTd"><code>CAMEL_AGGREGATION</code></td><td
colspan="1" rowspan="1" class="confluenceTd">Table name</td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd"><code>pkColumns</code></td><td
colspan="1" rowspan="1" class="confluenceTd"><code>NAME</code>,<code>KEY</code></td><td
colspan="1" rowspan="1" class="confluenceTd">Primary key columns</td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd"><code>exchangeIdColumn</code></td><td
colspan="1" rowspan="1" class="confluenceTd"><code>EXCHANGE_ID</code></td>
 <td colspan="1" rowspan="1" class="confluenceTd">Exchange Id column</td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd"><code>exchangeColumn</code></td><td
colspan="1" rowspan="1" class="confluenceTd"><code>EXCHANGE</code></td><td
colspan="1" rowspan="1" class="confluenceTd">Exchange content column</td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd"><code>name</code></td><td
colspan="1" rowspan="1" class="confluenceTd">&#160;</td><td colspan="1" rowspan="1"
class="confluenceTd">Repository name, value used for <code>NAME</code> column</td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd"><code>ttl</code></td><td
colspan="1" rowspan="1" class="confluenceTd">&#160;</td><td colspan="1" rowspan="1"
class="confluenceTd">Exchange time to live</td></tr><tr><td colspan="1"
rowspan="1" class="confluenceTd"><code>writeConsistencyLevel</code></td><td
colspan="1" rowspan="1" class="confluenceTd">&#160;</td><td colspan="1" rowspan="1"
class="confluenceTd">Consistency l
 evel used to insert/delete exchange: <code>ANY</code>, <code>ONE</code>,
<code>TWO</code>, <code>QUORUM</code>, <code>LOCAL_QUORUM</code>&#8230;</td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd"><code>readConsistencyLevel</code></td><td
colspan="1" rowspan="1" class="confluenceTd">&#160;</td><td colspan="1" rowspan="1"
class="confluenceTd">Consistency level used to read/check exchange: <code>ONE</code>,
<code>TWO</code>, <code>QUORUM</code>, <code>LOCAL_QUORUM</code>&#8230;</td></tr></tbody></table></div></div>
         </td>
         <td valign="top">
           <div class="navigation">



Mime
View raw message