Author: buildbot Date: Wed Aug 24 10:19:36 2016 New Revision: 995799 Log: Production update by buildbot for camel
Modified: websites/production/camel/content/cache/main.pageCache websites/production/camel/content/couchdb.html Modified: websites/production/camel/content/cache/main.pageCache ============================================================================== Binary files - no diff available. Modified: websites/production/camel/content/couchdb.html ============================================================================== --- websites/production/camel/content/couchdb.html (original) +++ websites/production/camel/content/couchdb.html Wed Aug 24 10:19:36 2016 @@ -85,79 +85,25 @@ <tbody> <tr> <td valign="top" width="100%"> -<div class="wiki-content maincontent"><h2 id="CouchDB-CamelCouchDBcomponent">Camel CouchDB component</h2> - -<p><strong>Available as of Camel 2.11</strong></p> - -<p>The <strong>couchdb:</strong> component allows you to treat <a shape="rect" class="external-link" href="http://couchdb.apache.org/">CouchDB</a> instances as a producer or consumer of messages. Using the lightweight LightCouch API, this camel component has the following features:</p> - -<ul><li>As a consumer, monitors couch changesets for inserts, updates and deletes and publishes these as messages into camel routes.</li><li>As a producer, can save or update documents into couch.</li><li>Can support as many endpoints as required, eg for multiple databases across multiple instances.</li><li>Ability to have events trigger for only deletes, only inserts/updates or all (default).</li><li>Headers set for sequenceId, document revision, document id, and HTTP method type.</li></ul> - - -<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="codeContent panelContent pdl"> -<script class="brush: xml; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[ -<dependency> +<div class="wiki-content maincontent"><h2 id="CouchDB-CamelCouchDBcomponent">Camel CouchDB component</h2><p><strong>Available as of Camel 2.11</strong></p><p>The <strong>couchdb:</strong> component allows you to treat <a shape="rect" class="external-link" href="http://couchdb.apache.org/">CouchDB</a> instances as a producer or consumer of messages. Using the lightweight LightCouch API, this camel component has the following features:</p><ul><li>As a consumer, monitors couch changesets for inserts, updates and deletes and publishes these as messages into camel routes.</li><li>As a producer, can save, update and from <strong>Camel 2.18</strong>  delete (by using <span>CouchDbMethod with DELETE value)</span> documents into couch.</li><li>Can support as many endpoints as required, eg for multiple databases across multiple instances.</li><li>Ability to have events trigger for only deletes, only inserts/updates or all (default).</li><li>Headers set for sequenceId, document revis ion, document id, and HTTP method type.</li></ul><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="codeContent panelContent pdl"> +<script class="brush: xml; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[<dependency> <groupId>org.apache.camel</groupId> <artifactId>camel-couchdb</artifactId> <version>x.x.x</version> <!-- use the same version as your Camel core version --> </dependency> ]]></script> -</div></div> - -<h3 id="CouchDB-URIformat">URI format</h3> - -<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> -<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[ -couchdb:http://hostname[:port]/database?[options] +</div></div><h3 id="CouchDB-URIformat">URI format</h3><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> +<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[couchdb:http://hostname[:port]/database?[options] ]]></script> -</div></div> - -<p>Where <strong>hostname</strong> is the hostname of the running couchdb instance. Port is optional and if not specified then defaults to 5984.</p> - -<h3 id="CouchDB-Options">Options</h3> -<div class="confluenceTableSmall"> -<div class="table-wrap"><table class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1" class="confluenceTh"><p> Property </p></th><th colspan="1" rowspan="1" class="confluenceTh"><p> Default </p></th><th colspan="1" rowspan="1" class="confluenceTh"><p> Description </p></th></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>deletes</code> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>true</code> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> document deletes are published as events </p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>updates</code> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>true</code> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> document inserts/updates are published as events </p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>heartbeat</code> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>30000 </code> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> how often to send an empty message to keep socket alive in millis </p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>createDatabase</code> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>true</code> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> create the database if it does not already exist </p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>username</code> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>null</code> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> username in case of authenticated databases </p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>password</code> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>null</code> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> password for authenticated databases </p></td></tr></tbod y></table></div> -</div> - -<h3 id="CouchDB-Headers">Headers</h3> - -<p>The following headers are set on exchanges during message transport.</p> -<div class="confluenceTableSmall"> -<div class="table-wrap"><table class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1" class="confluenceTh"><p> Property </p></th><th colspan="1" rowspan="1" class="confluenceTh"><p> Value </p></th></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>CouchDbDatabase</code> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> the database the message came from </p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>CouchDbSeq</code> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> the couchdb changeset sequence number of the update / delete message </p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>CouchDbId</code> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> the couchdb document id </p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>CouchDbRev</code> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> the couchdb document revision </p></td></ tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>CouchDbMethod</code> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> the method (delete / update) </p></td></tr></tbody></table></div> -</div> - -<p>Headers are set by the consumer once the message is received. The producer will also set the headers for downstream processors once the insert/update has taken place. Any headers set prior to the producer are ignored. That means for example, if you set CouchDbId as a header, it will not be used as the id for insertion, the id of the document will still be used.</p> - -<h3 id="CouchDB-MessageBody">Message Body</h3> - -<p>The component will use the message body as the document to be inserted. If the body is an instance of String, then it will be marshalled into a GSON object before insert. This means that the string must be valid JSON or the insert / update will fail. If the body is an instance of a com.google.gson.JsonElement then it will be inserted as is. Otherwise the producer will throw an exception of unsupported body type.</p> - -<h3 id="CouchDB-Samples">Samples</h3> - -<p>For example if you wish to consume all inserts, updates and deletes from a CouchDB instance running locally, on port 9999 then you could use the following:</p> - -<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> -<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[ -from("couchdb:http://localhost:9999").process(someProcessor); +</div></div><p>Where <strong>hostname</strong> is the hostname of the running couchdb instance. Port is optional and if not specified then defaults to 5984.</p><h3 id="CouchDB-Options">Options</h3><div class="confluenceTableSmall"><div class="table-wrap"><table class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1" class="confluenceTh"><p>Property</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>Default</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>Description</p></th></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>deletes</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>true</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>document deletes are published as events</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>updates</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>true</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>do cument inserts/updates are published as events</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>heartbeat</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>30000</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>how often to send an empty message to keep socket alive in millis</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>createDatabase</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>true</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>create the database if it does not already exist</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>username</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>null</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>username in case of authenticated databases</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>password</code></p></ td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>null</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>password for authenticated databases</p></td></tr></tbody></table></div></div><h3 id="CouchDB-Headers">Headers</h3><p>The following headers are set on exchanges during message transport.</p><div class="confluenceTableSmall"><div class="table-wrap"><table class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1" class="confluenceTh"><p>Property</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>Value</p></th></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>CouchDbDatabase</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>the database the message came from</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>CouchDbSeq</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>the couchdb changeset sequence number of the update / delete message</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>CouchDbId</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>the couchdb document id</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>CouchDbRev</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>the couchdb document revision</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>CouchDbMethod</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>the method (delete / update)</p></td></tr></tbody></table></div></div><p>Headers are set by the consumer once the message is received. The producer will also set the headers for downstream processors once the insert/update has taken place. Any headers set prior to the producer are ignored. That means for example, if you set CouchDbId as a header, it will not be used as the id for insertion, the id of the document will still be used.</p><h3 id="CouchDB-MessageBody">Message Body</h3><p>The component will use th e message body as the document to be inserted. If the body is an instance of String, then it will be marshalled into a GSON object before insert. This means that the string must be valid JSON or the insert / update will fail. If the body is an instance of a com.google.gson.JsonElement then it will be inserted as is. Otherwise the producer will throw an exception of unsupported body type.</p><h3 id="CouchDB-Samples">Samples</h3><p>For example if you wish to consume all inserts, updates and deletes from a CouchDB instance running locally, on port 9999 then you could use the following:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> +<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[from("couchdb:http://localhost:9999").process(someProcessor); ]]></script> -</div></div> - -<p>If you were only interested in deletes, then you could use the following</p> - -<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> -<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[ -from("couchdb:http://localhost:9999?updates=false").process(someProcessor); +</div></div><p>If you were only interested in deletes, then you could use the following</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> +<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[from("couchdb:http://localhost:9999?updates=false").process(someProcessor); ]]></script> -</div></div> - -<p>If you wanted to insert a message as a document, then the body of the exchange is used</p> - -<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> -<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[ -from("someProducingEndpoint").process(someProcessor).to("couchdb:http://localhost:9999") +</div></div><p>If you wanted to insert a message as a document, then the body of the exchange is used</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> +<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[from("someProducingEndpoint").process(someProcessor).to("couchdb:http://localhost:9999") ]]></script> </div></div></div> </td>