You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by bu...@apache.org on 2015/05/18 18:18:39 UTC

svn commit: r951750 - in /websites/production/camel/content: cache/main.pageCache mongodb.html

Author: buildbot
Date: Mon May 18 16:18:38 2015
New Revision: 951750

Log:
Production update by buildbot for camel

Modified:
    websites/production/camel/content/cache/main.pageCache
    websites/production/camel/content/mongodb.html

Modified: websites/production/camel/content/cache/main.pageCache
==============================================================================
Binary files - no diff available.

Modified: websites/production/camel/content/mongodb.html
==============================================================================
--- websites/production/camel/content/mongodb.html (original)
+++ websites/production/camel/content/mongodb.html Mon May 18 16:18:38 2015
@@ -96,7 +96,7 @@
 </div></div><h2 id="MongoDB-URIformat">URI format</h2><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
 <script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[mongodb:connectionBean?database=databaseName&amp;collection=collectionName&amp;operation=operationName[&amp;moreOptions...]
 ]]></script>
-</div></div><h2 id="MongoDB-Endpointoptions">Endpoint options</h2><p>MongoDB endpoints support the following options, depending on whether they are acting like a Producer or as a Consumer (options vary based on the consumer type too).</p><div class="confluenceTableSmall">&#160;</div><div class="table-wrap"><table class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1" class="confluenceTh"><p>Name</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>Default Value</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>Description</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>Producer</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>Tailable Cursor Consumer</p></th></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>database</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>none</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Required.</strong> The name of the database to which this endpoint
  will be bound. All operations will be executed against this database unless dynamicity is enabled and the&#160;<code>CamelMongoDbDatabase</code> header is set.</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><img class="emoticon emoticon-tick" src="https://cwiki.apache.org/confluence/s/en_GB-1988229788/4109/76e0dbb30bc8580e459c201f3535d84f9283a9ac.1/_/images/icons/emoticons/check.png" data-emoticon-name="tick" alt="(tick)"></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><img class="emoticon emoticon-tick" src="https://cwiki.apache.org/confluence/s/en_GB-1988229788/4109/76e0dbb30bc8580e459c201f3535d84f9283a9ac.1/_/images/icons/emoticons/check.png" data-emoticon-name="tick" alt="(tick)"></p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>collection</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>none</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Required (Except for <span>getDbStats and command 
 operations)</span>.</strong> The name of the collection (within the specified database) to which this endpoint will be bound.&#160;All operations will be executed against this database unless dynamicity is enabled and the&#160;<code>CamelMongoDbDatabase</code> header is set.</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><img class="emoticon emoticon-tick" src="https://cwiki.apache.org/confluence/s/en_GB-1988229788/4109/76e0dbb30bc8580e459c201f3535d84f9283a9ac.1/_/images/icons/emoticons/check.png" data-emoticon-name="tick" alt="(tick)"></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><img class="emoticon emoticon-tick" src="https://cwiki.apache.org/confluence/s/en_GB-1988229788/4109/76e0dbb30bc8580e459c201f3535d84f9283a9ac.1/_/images/icons/emoticons/check.png" data-emoticon-name="tick" alt="(tick)"></p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>collectionIndex</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>non
 e</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong><strong>Available as of </strong>Camel 2.12:</strong> An optional <a shape="rect" class="external-link" href="http://docs.mongodb.org/manual/core/index-single/" rel="nofollow">single field index</a> or <a shape="rect" class="external-link" href="http://docs.mongodb.org/manual/core/index-compound/" rel="nofollow">compound index</a> to create when inserting new collections.</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><img class="emoticon emoticon-tick" src="https://cwiki.apache.org/confluence/s/en_GB-1988229788/4109/76e0dbb30bc8580e459c201f3535d84f9283a9ac.1/_/images/icons/emoticons/check.png" data-emoticon-name="tick" alt="(tick)"></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>&#160;</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>operation</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>none</p></td><td colspan="1" rowspan="1" class="confl
 uenceTd"><p><strong>Required for producers.</strong> The id of the operation this endpoint will execute. Pick from the following:</p><ul><li>Query operations: <code>findById</code>, <code>findOneByQuery</code>, <code>findAll</code>, <code>count</code></li><li>Write operations: <code>insert</code>, <code>save</code>, <code>update</code></li><li>Delete operations: <code>remove</code></li><li>Other operations: <code>getDbStats</code>, <code>getColStats</code>, <code>aggregate,<span>&#160;</span>command</code></li></ul></td><td colspan="1" rowspan="1" class="confluenceTd"><p><img class="emoticon emoticon-tick" src="https://cwiki.apache.org/confluence/s/en_GB-1988229788/4109/76e0dbb30bc8580e459c201f3535d84f9283a9ac.1/_/images/icons/emoticons/check.png" data-emoticon-name="tick" alt="(tick)"></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>&#160;</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>createCollection</code></p></td><td colspan="1" rowspan="
 1" class="confluenceTd"><p>true</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Determines whether the collection will be automatically created in the MongoDB database during endpoint initialisation if it doesn't exist already. If this option is <code>false</code> and the collection doesn't exist, an initialisation exception will be thrown.</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><img class="emoticon emoticon-tick" src="https://cwiki.apache.org/confluence/s/en_GB-1988229788/4109/76e0dbb30bc8580e459c201f3535d84f9283a9ac.1/_/images/icons/emoticons/check.png" data-emoticon-name="tick" alt="(tick)"></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>&#160;</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>invokeGetLastError</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>false (behaviour may be inherited from connections WriteConcern)</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>R
 emove in camel 2.16</strong></p><p>Instructs the MongoDB Java driver to invoke <code>getLastError()</code> after every call. Default behaviour in version 2.7.2 of the MongoDB Java driver is that only network errors will cause the operation to fail, because the actual operation is executed asynchronously in the MongoDB server without holding up the client - to increase performance. The client can obtain the real result of the operation by explicitly invoking <code>getLastError()</code> on the <code>WriteResult</code> object returned or by setting the appropriate <code>WriteConcern</code>. If the backend operation has not finished yet, the client will block until the result is available. Setting this option to <code>true</code> will make the endpoint behave synchronously and return an Exception if the underlying operation failed.</p><p>WriteConcern should be preferred to detect if write occurs without errors. MongoDB strongly discourage to use this method as it is not reliable.</p></t
 d><td colspan="1" rowspan="1" class="confluenceTd"><p><img class="emoticon emoticon-tick" src="https://cwiki.apache.org/confluence/s/en_GB-1988229788/4109/76e0dbb30bc8580e459c201f3535d84f9283a9ac.1/_/images/icons/emoticons/check.png" data-emoticon-name="tick" alt="(tick)"></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>&#160;</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>writeConcern</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>none (driver's default)</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Set a <code>WriteConcern</code> on the operation out of MongoDB's parameterised values. See <a shape="rect" class="external-link" href="http://api.mongodb.org/java/current/com/mongodb/WriteConcern.html#valueOf(java.lang.String)" rel="nofollow">WriteConcern.valueOf(String)</a>.</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><img class="emoticon emoticon-tick" src="https://cwiki.apache.org/confluence/s/
 en_GB-1988229788/4109/76e0dbb30bc8580e459c201f3535d84f9283a9ac.1/_/images/icons/emoticons/check.png" data-emoticon-name="tick" alt="(tick)"></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>&#160;</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>writeConcernRef</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>none</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Sets a custom <code>WriteConcern</code> that exists in the Registry. Specify the bean name.</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><img class="emoticon emoticon-tick" src="https://cwiki.apache.org/confluence/s/en_GB-1988229788/4109/76e0dbb30bc8580e459c201f3535d84f9283a9ac.1/_/images/icons/emoticons/check.png" data-emoticon-name="tick" alt="(tick)"></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>&#160;</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>readPreference</code></p></td><td colspan="1" rowspa
 n="1" class="confluenceTd"><p>none</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Available as of Camel 2.12.4, 2.13.1 and 2.14.0:</strong> Sets a <a shape="rect" class="external-link" href="http://api.mongodb.org/java/current/com/mongodb/ReadPreference.html" rel="nofollow">ReadPreference</a> on the connection. Accepted values are those supported by the <a shape="rect" class="external-link" href="http://api.mongodb.org/java/current/com/mongodb/ReadPreference.html#valueOf(java.lang.String)" rel="nofollow">ReadPreference#valueOf()</a> public API. Currently as of MongoDB-Java-Driver version 2.12.0 the supported values are: <code>primary</code>, <code>primaryPreferred</code>, <code>secondary</code>, <code>secondaryPreferred</code> and <code>nearest</code>. See also the <a shape="rect" class="external-link" href="http://docs.mongodb.org/manual/core/read-preference/" rel="nofollow">documentation</a> for more details about this option.</p></td><td colspan="1" rowspan="
 1" class="confluenceTd"><p><img class="emoticon emoticon-tick" src="https://cwiki.apache.org/confluence/s/en_GB-1988229788/4109/76e0dbb30bc8580e459c201f3535d84f9283a9ac.1/_/images/icons/emoticons/check.png" data-emoticon-name="tick" alt="(tick)"></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>&#160;</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>dynamicity</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>false</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>If set to true, the endpoint will inspect the <code>CamelMongoDbDatabase</code> and <code>CamelMongoDbCollection</code> headers of the incoming message, and if any of them exists, the target collection and/or database will be overridden for that particular operation. Set to false by default to avoid triggering the lookup on every Exchange if the feature is not desired.</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><img class="emoticon emoticon-ti
 ck" src="https://cwiki.apache.org/confluence/s/en_GB-1988229788/4109/76e0dbb30bc8580e459c201f3535d84f9283a9ac.1/_/images/icons/emoticons/check.png" data-emoticon-name="tick" alt="(tick)"></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>&#160;</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>writeResultAsHeader</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>false</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Available as of Camel 2.10.3 and 2.11:</strong> In write operations (save, update, insert, etc.), instead of replacing the body with the WriteResult object returned by MongoDB, keep the input body untouched and place the WriteResult in the <code>CamelMongoWriteResult</code> header (constant <code>MongoDbConstants.WRITERESULT</code>).</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><img class="emoticon emoticon-tick" src="https://cwiki.apache.org/confluence/s/en_GB-1988229788/4109/76e0dbb30
 bc8580e459c201f3535d84f9283a9ac.1/_/images/icons/emoticons/check.png" data-emoticon-name="tick" alt="(tick)"></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>&#160;</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd">DBCursor</td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>DBObjectList</code><span>&#160;for findAll</span></p><p><span><code>DBObject</code><span>&#160;for all other operations</span></span></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Available as of Camel 2.16 : </strong><span style="line-height: 1.4285715;">Convert the output of the producer to the selected type : "DBObjectList", "DBObject" or "DBCursor" :</span></p><ul><li><span><span style="line-height: 1.4285715;"><code>DBObjectList</code> or </span><code style="line-height: 1.4285715;">DBCursor </code><span style="line-height: 1.4285715;">(may be </span>useful<span style="line-height: 1.4285715;"> to stream the output) applies to findAll.</span></span
 ></li><li><span><code>DBObject</code> </span>applies to all other operations.</li></ul></td><td colspan="1" rowspan="1" class="confluenceTd">&#160;</td><td colspan="1" rowspan="1" class="confluenceTd">&#160;</td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>persistentTailTracking</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>false</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Enables or disables persistent tail tracking for Tailable Cursor consumers. See below for more information.</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>&#160;</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><img class="emoticon emoticon-tick" src="https://cwiki.apache.org/confluence/s/en_GB-1988229788/4109/76e0dbb30bc8580e459c201f3535d84f9283a9ac.1/_/images/icons/emoticons/check.png" data-emoticon-name="tick" alt="(tick)"></p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>persistentId</code></p></td><td 
 colspan="1" rowspan="1" class="confluenceTd"><p>none</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Required if persistent tail tracking is enabled.</strong> The id of this persistent tail tracker, to separate its records from the rest on the tail-tracking collection.</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>&#160;</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><img class="emoticon emoticon-tick" src="https://cwiki.apache.org/confluence/s/en_GB-1988229788/4109/76e0dbb30bc8580e459c201f3535d84f9283a9ac.1/_/images/icons/emoticons/check.png" data-emoticon-name="tick" alt="(tick)"></p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>tailTrackingIncreasingField</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>none</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Required if persistent tail tracking is enabled.</strong> Correlation field in the incoming record which is of increa
 sing nature and will be used to position the tailing cursor every time it is generated. The cursor will be (re)created with a query of type: tailTrackIncreasingField &gt; lastValue (where lastValue is possibly recovered from persistent tail tracking). Can be of type Integer, Date, String, etc. NOTE: No support for dot notation at the current time, so the field should be at the top level of the document.</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>&#160;</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><img class="emoticon emoticon-tick" src="https://cwiki.apache.org/confluence/s/en_GB-1988229788/4109/76e0dbb30bc8580e459c201f3535d84f9283a9ac.1/_/images/icons/emoticons/check.png" data-emoticon-name="tick" alt="(tick)"></p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>cursorRegenerationDelay</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>1000ms</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Establishe
 s how long the endpoint will wait to regenerate the cursor after it has been killed by the MongoDB server (normal behaviour).</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>&#160;</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><img class="emoticon emoticon-tick" src="https://cwiki.apache.org/confluence/s/en_GB-1988229788/4109/76e0dbb30bc8580e459c201f3535d84f9283a9ac.1/_/images/icons/emoticons/check.png" data-emoticon-name="tick" alt="(tick)"></p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>tailTrackDb</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>same as endpoint's</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Database on which the persistent tail tracker will store its runtime information.</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>&#160;</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><img class="emoticon emoticon-tick" src="https://cwiki.apache.org/confluence/s/en_
 GB-1988229788/4109/76e0dbb30bc8580e459c201f3535d84f9283a9ac.1/_/images/icons/emoticons/check.png" data-emoticon-name="tick" alt="(tick)"></p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>tailTrackCollection</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>camelTailTracking</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Collection on which the persistent tail tracker will store its runtime information.</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>&#160;</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><img class="emoticon emoticon-tick" src="https://cwiki.apache.org/confluence/s/en_GB-1988229788/4109/76e0dbb30bc8580e459c201f3535d84f9283a9ac.1/_/images/icons/emoticons/check.png" data-emoticon-name="tick" alt="(tick)"></p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>tailTrackField</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>lastTrackingValue</p></td><td c
 olspan="1" rowspan="1" class="confluenceTd"><p>Field in which the persistent tail tracker will store the last tracked value.</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>&#160;</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><img class="emoticon emoticon-tick" src="https://cwiki.apache.org/confluence/s/en_GB-1988229788/4109/76e0dbb30bc8580e459c201f3535d84f9283a9ac.1/_/images/icons/emoticons/check.png" data-emoticon-name="tick" alt="(tick)"></p></td></tr></tbody></table></div><h2 id="MongoDB-ConfigurationofdatabaseinSpringXML">Configuration of database in Spring XML</h2><p>The following Spring XML creates a bean defining the connection to a MongoDB instance.</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+</div></div><h2 id="MongoDB-Endpointoptions">Endpoint options</h2><p>MongoDB endpoints support the following options, depending on whether they are acting like a Producer or as a Consumer (options vary based on the consumer type too).</p><div class="confluenceTableSmall">&#160;</div><div class="table-wrap"><table class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1" class="confluenceTh"><p>Name</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>Default Value</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>Description</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>Producer</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>Tailable Cursor Consumer</p></th></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>database</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>none</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Required.</strong> The name of the database to which this endpoint
  will be bound. All operations will be executed against this database unless dynamicity is enabled and the&#160;<code>CamelMongoDbDatabase</code> header is set.</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><img class="emoticon emoticon-tick" src="https://cwiki.apache.org/confluence/s/en_GB-1988229788/4109/76e0dbb30bc8580e459c201f3535d84f9283a9ac.1/_/images/icons/emoticons/check.png" data-emoticon-name="tick" alt="(tick)"></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><img class="emoticon emoticon-tick" src="https://cwiki.apache.org/confluence/s/en_GB-1988229788/4109/76e0dbb30bc8580e459c201f3535d84f9283a9ac.1/_/images/icons/emoticons/check.png" data-emoticon-name="tick" alt="(tick)"></p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>collection</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>none</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Required (Except for <span>getDbStats and command 
 operations)</span>.</strong> The name of the collection (within the specified database) to which this endpoint will be bound.&#160;All operations will be executed against this database unless dynamicity is enabled and the&#160;<code>CamelMongoDbDatabase</code> header is set.</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><img class="emoticon emoticon-tick" src="https://cwiki.apache.org/confluence/s/en_GB-1988229788/4109/76e0dbb30bc8580e459c201f3535d84f9283a9ac.1/_/images/icons/emoticons/check.png" data-emoticon-name="tick" alt="(tick)"></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><img class="emoticon emoticon-tick" src="https://cwiki.apache.org/confluence/s/en_GB-1988229788/4109/76e0dbb30bc8580e459c201f3535d84f9283a9ac.1/_/images/icons/emoticons/check.png" data-emoticon-name="tick" alt="(tick)"></p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>collectionIndex</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>non
 e</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong><strong>Available as of </strong>Camel 2.12:</strong> An optional <a shape="rect" class="external-link" href="http://docs.mongodb.org/manual/core/index-single/" rel="nofollow">single field index</a> or <a shape="rect" class="external-link" href="http://docs.mongodb.org/manual/core/index-compound/" rel="nofollow">compound index</a> to create when inserting new collections.</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><img class="emoticon emoticon-tick" src="https://cwiki.apache.org/confluence/s/en_GB-1988229788/4109/76e0dbb30bc8580e459c201f3535d84f9283a9ac.1/_/images/icons/emoticons/check.png" data-emoticon-name="tick" alt="(tick)"></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>&#160;</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>operation</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>none</p></td><td colspan="1" rowspan="1" class="confl
 uenceTd"><p><strong>Required for producers.</strong> The id of the operation this endpoint will execute. Pick from the following:</p><ul><li>Query operations: <code>findById</code>, <code>findOneByQuery</code>, <code>findAll</code>, <code>count</code></li><li>Write operations: <code>insert</code>, <code>save</code>, <code>update</code></li><li>Delete operations: <code>remove</code></li><li>Other operations: <code>getDbStats</code>, <code>getColStats</code>, <code>aggregate,<span>&#160;</span>command</code></li></ul></td><td colspan="1" rowspan="1" class="confluenceTd"><p><img class="emoticon emoticon-tick" src="https://cwiki.apache.org/confluence/s/en_GB-1988229788/4109/76e0dbb30bc8580e459c201f3535d84f9283a9ac.1/_/images/icons/emoticons/check.png" data-emoticon-name="tick" alt="(tick)"></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>&#160;</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>createCollection</code></p></td><td colspan="1" rowspan="
 1" class="confluenceTd"><p>true</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Determines whether the collection will be automatically created in the MongoDB database during endpoint initialisation if it doesn't exist already. If this option is <code>false</code> and the collection doesn't exist, an initialisation exception will be thrown.</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><img class="emoticon emoticon-tick" src="https://cwiki.apache.org/confluence/s/en_GB-1988229788/4109/76e0dbb30bc8580e459c201f3535d84f9283a9ac.1/_/images/icons/emoticons/check.png" data-emoticon-name="tick" alt="(tick)"></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>&#160;</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>invokeGetLastError</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>false (behaviour may be inherited from connections WriteConcern)</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>R
 emove in camel 2.16</strong></p><p>Instructs the MongoDB Java driver to invoke <code>getLastError()</code> after every call. Default behaviour in version 2.7.2 of the MongoDB Java driver is that only network errors will cause the operation to fail, because the actual operation is executed asynchronously in the MongoDB server without holding up the client - to increase performance. The client can obtain the real result of the operation by explicitly invoking <code>getLastError()</code> on the <code>WriteResult</code> object returned or by setting the appropriate <code>WriteConcern</code>. If the backend operation has not finished yet, the client will block until the result is available. Setting this option to <code>true</code> will make the endpoint behave synchronously and return an Exception if the underlying operation failed.</p><p>WriteConcern should be preferred to detect if write occurs without errors. MongoDB strongly discourage to use this method as it is not reliable.</p></t
 d><td colspan="1" rowspan="1" class="confluenceTd"><p><img class="emoticon emoticon-tick" src="https://cwiki.apache.org/confluence/s/en_GB-1988229788/4109/76e0dbb30bc8580e459c201f3535d84f9283a9ac.1/_/images/icons/emoticons/check.png" data-emoticon-name="tick" alt="(tick)"></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>&#160;</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>writeConcern</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>none (driver's default)</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Set a <code>WriteConcern</code> on the operation out of MongoDB's parameterised values. See <a shape="rect" class="external-link" href="http://api.mongodb.org/java/current/com/mongodb/WriteConcern.html#valueOf(java.lang.String)" rel="nofollow">WriteConcern.valueOf(String)</a>.</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><img class="emoticon emoticon-tick" src="https://cwiki.apache.org/confluence/s/
 en_GB-1988229788/4109/76e0dbb30bc8580e459c201f3535d84f9283a9ac.1/_/images/icons/emoticons/check.png" data-emoticon-name="tick" alt="(tick)"></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>&#160;</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>writeConcernRef</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>none</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Sets a custom <code>WriteConcern</code> that exists in the Registry. Specify the bean name.</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><img class="emoticon emoticon-tick" src="https://cwiki.apache.org/confluence/s/en_GB-1988229788/4109/76e0dbb30bc8580e459c201f3535d84f9283a9ac.1/_/images/icons/emoticons/check.png" data-emoticon-name="tick" alt="(tick)"></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>&#160;</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>readPreference</code></p></td><td colspan="1" rowspa
 n="1" class="confluenceTd"><p>none</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Available as of Camel 2.12.4, 2.13.1 and 2.14.0:</strong> Sets a <a shape="rect" class="external-link" href="http://api.mongodb.org/java/current/com/mongodb/ReadPreference.html" rel="nofollow">ReadPreference</a> on the connection. Accepted values are those supported by the <a shape="rect" class="external-link" href="http://api.mongodb.org/java/current/com/mongodb/ReadPreference.html#valueOf(java.lang.String)" rel="nofollow">ReadPreference#valueOf()</a> public API. Currently as of MongoDB-Java-Driver version 2.12.0 the supported values are: <code>primary</code>, <code>primaryPreferred</code>, <code>secondary</code>, <code>secondaryPreferred</code> and <code>nearest</code>. See also the <a shape="rect" class="external-link" href="http://docs.mongodb.org/manual/core/read-preference/" rel="nofollow">documentation</a> for more details about this option.</p></td><td colspan="1" rowspan="
 1" class="confluenceTd"><p><img class="emoticon emoticon-tick" src="https://cwiki.apache.org/confluence/s/en_GB-1988229788/4109/76e0dbb30bc8580e459c201f3535d84f9283a9ac.1/_/images/icons/emoticons/check.png" data-emoticon-name="tick" alt="(tick)"></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>&#160;</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>dynamicity</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>false</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>If set to true, the endpoint will inspect the <code>CamelMongoDbDatabase</code> and <code>CamelMongoDbCollection</code> headers of the incoming message, and if any of them exists, the target collection and/or database will be overridden for that particular operation. Set to false by default to avoid triggering the lookup on every Exchange if the feature is not desired.</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><img class="emoticon emoticon-ti
 ck" src="https://cwiki.apache.org/confluence/s/en_GB-1988229788/4109/76e0dbb30bc8580e459c201f3535d84f9283a9ac.1/_/images/icons/emoticons/check.png" data-emoticon-name="tick" alt="(tick)"></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>&#160;</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>writeResultAsHeader</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>false</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Available as of Camel 2.10.3 and 2.11:</strong> In write operations (save, update, insert, etc.), instead of replacing the body with the WriteResult object returned by MongoDB, keep the input body untouched and place the WriteResult in the <code>CamelMongoWriteResult</code> header (constant <code>MongoDbConstants.WRITERESULT</code>).</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><img class="emoticon emoticon-tick" src="https://cwiki.apache.org/confluence/s/en_GB-1988229788/4109/76e0dbb30
 bc8580e459c201f3535d84f9283a9ac.1/_/images/icons/emoticons/check.png" data-emoticon-name="tick" alt="(tick)"></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>&#160;</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd">outputType</td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>DBObjectList</code><span>&#160;for findAll</span></p><p><span><code>DBObject</code><span>&#160;for all other operations</span></span></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Available as of Camel 2.16 : </strong><span style="line-height: 1.4285715;">Convert the output of the producer to the selected type : "DBObjectList", "DBObject" or "DBCursor" :</span></p><ul><li><span><span style="line-height: 1.4285715;"><code>DBObjectList</code> or </span><code style="line-height: 1.4285715;">DBCursor </code><span style="line-height: 1.4285715;">(may be </span>useful<span style="line-height: 1.4285715;"> to stream the output) applies to findAll.</span></sp
 an></li><li><span><code>DBObject</code> </span>applies to all other operations.</li></ul></td><td colspan="1" rowspan="1" class="confluenceTd">&#160;</td><td colspan="1" rowspan="1" class="confluenceTd">&#160;</td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>persistentTailTracking</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>false</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Enables or disables persistent tail tracking for Tailable Cursor consumers. See below for more information.</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>&#160;</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><img class="emoticon emoticon-tick" src="https://cwiki.apache.org/confluence/s/en_GB-1988229788/4109/76e0dbb30bc8580e459c201f3535d84f9283a9ac.1/_/images/icons/emoticons/check.png" data-emoticon-name="tick" alt="(tick)"></p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>persistentId</code></p></td><t
 d colspan="1" rowspan="1" class="confluenceTd"><p>none</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Required if persistent tail tracking is enabled.</strong> The id of this persistent tail tracker, to separate its records from the rest on the tail-tracking collection.</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>&#160;</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><img class="emoticon emoticon-tick" src="https://cwiki.apache.org/confluence/s/en_GB-1988229788/4109/76e0dbb30bc8580e459c201f3535d84f9283a9ac.1/_/images/icons/emoticons/check.png" data-emoticon-name="tick" alt="(tick)"></p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>tailTrackingIncreasingField</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>none</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Required if persistent tail tracking is enabled.</strong> Correlation field in the incoming record which is of incr
 easing nature and will be used to position the tailing cursor every time it is generated. The cursor will be (re)created with a query of type: tailTrackIncreasingField &gt; lastValue (where lastValue is possibly recovered from persistent tail tracking). Can be of type Integer, Date, String, etc. NOTE: No support for dot notation at the current time, so the field should be at the top level of the document.</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>&#160;</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><img class="emoticon emoticon-tick" src="https://cwiki.apache.org/confluence/s/en_GB-1988229788/4109/76e0dbb30bc8580e459c201f3535d84f9283a9ac.1/_/images/icons/emoticons/check.png" data-emoticon-name="tick" alt="(tick)"></p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>cursorRegenerationDelay</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>1000ms</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Establis
 hes how long the endpoint will wait to regenerate the cursor after it has been killed by the MongoDB server (normal behaviour).</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>&#160;</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><img class="emoticon emoticon-tick" src="https://cwiki.apache.org/confluence/s/en_GB-1988229788/4109/76e0dbb30bc8580e459c201f3535d84f9283a9ac.1/_/images/icons/emoticons/check.png" data-emoticon-name="tick" alt="(tick)"></p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>tailTrackDb</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>same as endpoint's</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Database on which the persistent tail tracker will store its runtime information.</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>&#160;</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><img class="emoticon emoticon-tick" src="https://cwiki.apache.org/confluence/s/e
 n_GB-1988229788/4109/76e0dbb30bc8580e459c201f3535d84f9283a9ac.1/_/images/icons/emoticons/check.png" data-emoticon-name="tick" alt="(tick)"></p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>tailTrackCollection</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>camelTailTracking</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Collection on which the persistent tail tracker will store its runtime information.</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>&#160;</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><img class="emoticon emoticon-tick" src="https://cwiki.apache.org/confluence/s/en_GB-1988229788/4109/76e0dbb30bc8580e459c201f3535d84f9283a9ac.1/_/images/icons/emoticons/check.png" data-emoticon-name="tick" alt="(tick)"></p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>tailTrackField</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>lastTrackingValue</p></td><td
  colspan="1" rowspan="1" class="confluenceTd"><p>Field in which the persistent tail tracker will store the last tracked value.</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>&#160;</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><img class="emoticon emoticon-tick" src="https://cwiki.apache.org/confluence/s/en_GB-1988229788/4109/76e0dbb30bc8580e459c201f3535d84f9283a9ac.1/_/images/icons/emoticons/check.png" data-emoticon-name="tick" alt="(tick)"></p></td></tr></tbody></table></div><h2 id="MongoDB-ConfigurationofdatabaseinSpringXML">Configuration of database in Spring XML</h2><p>The following Spring XML creates a bean defining the connection to a MongoDB instance.</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
 <script class="theme: Default; brush: xml; gutter: false" type="syntaxhighlighter"><![CDATA[&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
 &lt;beans xmlns=&quot;http://www.springframework.org/schema/beans&quot;
     xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;