Component docs
Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/7fd20212 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/7fd20212 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/7fd20212 Branch: refs/heads/master Commit: 7fd202125cdced1d045e88f0bcf91a4a48cc4085 Parents: edeb0ce Author: Claus Ibsen <davscl...@apache.org> Authored: Sun May 15 10:51:39 2016 +0200 Committer: Claus Ibsen <davscl...@apache.org> Committed: Sun May 15 10:51:39 2016 +0200 ---------------------------------------------------------------------- .../camel-mongodb/src/main/docs/mongodb.adoc | 22 +++++++++++--------- .../component/mongodb/MongoDbEndpoint.java | 22 ++++++++++---------- 2 files changed, 23 insertions(+), 21 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/camel/blob/7fd20212/components/camel-mongodb/src/main/docs/mongodb.adoc ---------------------------------------------------------------------- diff --git a/components/camel-mongodb/src/main/docs/mongodb.adoc b/components/camel-mongodb/src/main/docs/mongodb.adoc index 8a4b54c..bd31941 100644 --- a/components/camel-mongodb/src/main/docs/mongodb.adoc +++ b/components/camel-mongodb/src/main/docs/mongodb.adoc @@ -63,6 +63,7 @@ The MongoDB component has no options. + // endpoint options: START The MongoDB component supports 22 endpoint options which are listed below: @@ -74,24 +75,24 @@ The MongoDB component supports 22 endpoint options which are listed below: | collection | common | | String | Sets the name of the MongoDB collection to bind to this endpoint | collectionIndex | common | | String | Sets the collection index (JSON FORMAT : field1 : order1 field2 : order2) | createCollection | common | true | boolean | Create collection during initialisation if it doesn't exist. Default is true. -| cursorRegenerationDelay | common | 1000 | long | MongoDB tailable cursors will block until new data arrives. If no new data is inserted after some time the cursor will be automatically freed and closed by the MongoDB server. The client is expected to regenerate the cursor if needed. This value specifies the time to wait before attempting to fetch a new cursor and if the attempt fails how long before the next attempt is made. Default value is 1000ms. | database | common | | String | Sets the name of the MongoDB database to target -| dynamicity | common | false | boolean | Sets whether this endpoint will attempt to dynamically resolve the target database and collection from the incoming Exchange properties. Can be used to override at runtime the database and collection specified on the otherwise static endpoint URI. It is disabled by default to boost performance. Enabling it will take a minimal performance hit. | operation | common | | MongoDbOperation | Sets the operation this endpoint will execute against MongoDB. For possible values see MongoDbOperation. | outputType | common | | MongoDbOutputType | Convert the output of the producer to the selected type : DBObjectList DBObject or DBCursor. DBObjectList or DBObject applies to findAll. DBCursor applies to all other operations. -| persistentId | common | | String | One tail tracking collection can host many trackers for several tailable consumers. To keep them separate each tracker should have its own unique persistentId. -| persistentTailTracking | common | false | boolean | Enable persistent tail tracking which is a mechanism to keep track of the last consumed message across system restarts. The next time the system is up the endpoint will recover the cursor from the point where it last stopped slurping records. -| readPreference | common | | ReadPreference | Sets a MongoDB ReadPreference on the Mongo connection. Read preferences set directly on the connection will be overridden by this setting. The link com.mongodb.ReadPreferencevalueOf(String) utility method is used to resolve the passed readPreference value. Some examples for the possible values are nearest primary or secondary etc. -| tailTrackCollection | common | | String | Collection where tail tracking information will be persisted. If not specified link MongoDbTailTrackingConfigDEFAULT_COLLECTION will be used by default. -| tailTrackDb | common | | String | Indicates what database the tail tracking mechanism will persist to. If not specified the current database will be picked by default. Dynamicity will not be taken into account even if enabled i.e. the tail tracking database will not vary past endpoint initialisation. -| tailTrackField | common | | String | Field where the last tracked value will be placed. If not specified link MongoDbTailTrackingConfigDEFAULT_FIELD will be used by default. -| tailTrackIncreasingField | common | | String | Correlation field in the incoming record which is of increasing 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 lastValue (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. | writeConcern | common | | WriteConcern | Set the WriteConcern for write operations on MongoDB using the standard ones. Resolved from the fields of the WriteConcern class by calling the link WriteConcernvalueOf(String) method. -| writeResultAsHeader | common | false | boolean | In write operations it determines whether instead of returning WriteResult as the body of the OUT message we transfer the IN message to the OUT and attach the WriteResult as a header. | bridgeErrorHandler | consumer | false | boolean | Allows for bridging the consumer to the Camel routing Error Handler which mean any exceptions occurred while the consumer is trying to pickup incoming messages or the likes will now be processed as a message and handled by the routing Error Handler. By default the consumer will use the org.apache.camel.spi.ExceptionHandler to deal with exceptions that will be logged at WARN/ERROR level and ignored. | exceptionHandler | consumer (advanced) | | ExceptionHandler | To let the consumer use a custom ExceptionHandler. Notice if the option bridgeErrorHandler is enabled then this options is not in use. By default the consumer will deal with exceptions that will be logged at WARN/ERROR level and ignored. +| cursorRegenerationDelay | advanced | 1000 | long | MongoDB tailable cursors will block until new data arrives. If no new data is inserted after some time the cursor will be automatically freed and closed by the MongoDB server. The client is expected to regenerate the cursor if needed. This value specifies the time to wait before attempting to fetch a new cursor and if the attempt fails how long before the next attempt is made. Default value is 1000ms. +| dynamicity | advanced | false | boolean | Sets whether this endpoint will attempt to dynamically resolve the target database and collection from the incoming Exchange properties. Can be used to override at runtime the database and collection specified on the otherwise static endpoint URI. It is disabled by default to boost performance. Enabling it will take a minimal performance hit. | exchangePattern | advanced | InOnly | ExchangePattern | Sets the default exchange pattern when creating an exchange +| readPreference | advanced | | ReadPreference | Sets a MongoDB ReadPreference on the Mongo connection. Read preferences set directly on the connection will be overridden by this setting. The link com.mongodb.ReadPreferencevalueOf(String) utility method is used to resolve the passed readPreference value. Some examples for the possible values are nearest primary or secondary etc. | synchronous | advanced | false | boolean | Sets whether synchronous processing should be strictly used or Camel is allowed to use asynchronous processing (if supported). +| writeResultAsHeader | advanced | false | boolean | In write operations it determines whether instead of returning WriteResult as the body of the OUT message we transfer the IN message to the OUT and attach the WriteResult as a header. +| persistentId | tail | | String | One tail tracking collection can host many trackers for several tailable consumers. To keep them separate each tracker should have its own unique persistentId. +| persistentTailTracking | tail | false | boolean | Enable persistent tail tracking which is a mechanism to keep track of the last consumed message across system restarts. The next time the system is up the endpoint will recover the cursor from the point where it last stopped slurping records. +| tailTrackCollection | tail | | String | Collection where tail tracking information will be persisted. If not specified link MongoDbTailTrackingConfigDEFAULT_COLLECTION will be used by default. +| tailTrackDb | tail | | String | Indicates what database the tail tracking mechanism will persist to. If not specified the current database will be picked by default. Dynamicity will not be taken into account even if enabled i.e. the tail tracking database will not vary past endpoint initialisation. +| tailTrackField | tail | | String | Field where the last tracked value will be placed. If not specified link MongoDbTailTrackingConfigDEFAULT_FIELD will be used by default. +| tailTrackIncreasingField | tail | | String | Correlation field in the incoming record which is of increasing 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 lastValue (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. |======================================================================= {% endraw %} // endpoint options: END @@ -99,6 +100,7 @@ The MongoDB component supports 22 endpoint options which are listed below: + [[MongoDB-ConfigurationofdatabaseinSpringXML]] Configuration of database in Spring XML ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ http://git-wip-us.apache.org/repos/asf/camel/blob/7fd20212/components/camel-mongodb/src/main/java/org/apache/camel/component/mongodb/MongoDbEndpoint.java ---------------------------------------------------------------------- diff --git a/components/camel-mongodb/src/main/java/org/apache/camel/component/mongodb/MongoDbEndpoint.java b/components/camel-mongodb/src/main/java/org/apache/camel/component/mongodb/MongoDbEndpoint.java index c433c38..577b574 100644 --- a/components/camel-mongodb/src/main/java/org/apache/camel/component/mongodb/MongoDbEndpoint.java +++ b/components/camel-mongodb/src/main/java/org/apache/camel/component/mongodb/MongoDbEndpoint.java @@ -69,29 +69,29 @@ public class MongoDbEndpoint extends DefaultEndpoint { @UriParam(enums = "ACKNOWLEDGED,W1,W2,W3,UNACKNOWLEDGED,JOURNALED,MAJORITY,SAFE") private WriteConcern writeConcern; private WriteConcern writeConcernRef; - @UriParam + @UriParam(label = "advanced") private ReadPreference readPreference; - @UriParam + @UriParam(label = "advanced") private boolean dynamicity; - @UriParam + @UriParam(label = "advanced") private boolean writeResultAsHeader; // tailable cursor consumer by default private MongoDbConsumerType consumerType; - @UriParam(defaultValue = "1000") + @UriParam(label = "advanced", defaultValue = "1000") private long cursorRegenerationDelay = 1000L; - @UriParam + @UriParam(label = "tail") private String tailTrackIncreasingField; - // persitent tail tracking - @UriParam + // persistent tail tracking + @UriParam(label = "tail") private boolean persistentTailTracking; - @UriParam + @UriParam(label = "tail") private String persistentId; - @UriParam + @UriParam(label = "tail") private String tailTrackDb; - @UriParam + @UriParam(label = "tail") private String tailTrackCollection; - @UriParam + @UriParam(label = "tail") private String tailTrackField; private MongoDbTailTrackingConfig tailTrackingConfig;