MongoDB

MongoDB

Scheme: mongodb
Name Kind Type Required Deprecated Default Value Enum Values Description
connectionBean path java.lang.String true false Name of {@link com.mongodb.Mongo} to use.
database parameter java.lang.String false Sets the name of the MongoDB database to target @param database name of the MongoDB database
collection parameter java.lang.String false Sets the name of the MongoDB collection to bind to this endpoint @param collection collection name
collectionIndex parameter java.lang.String false Sets the collection index (JSON FORMAT : { "field1" : order1, "field2" : order2})
operation parameter org.apache.camel.component.mongodb.MongoDbOperation false findById
findOneByQuery
findAll
insert
save
update
remove
aggregate
getDbStats
getColStats
count
command
Sets the operation this endpoint will execute against MongoDB. For possible values, see {@link MongoDbOperation}. @param operation name of the operation as per catalogued values @throws CamelMongoDbException
createCollection parameter boolean false true Create collection during initialisation if it doesn't exist. Default is true. @param createCollection true or false
invokeGetLastError parameter boolean false Instructs this endpoint to invoke {@link WriteResult#getLastError()} with every operation. By default, MongoDB does not wait for the write operation to occur before returning. If set to true, each exchange will only return after the write operation has actually occurred in MongoDB. @param invokeGetLastError true or false
writeConcern parameter com.mongodb.WriteConcern false Set the {@link WriteConcern} for write operations on MongoDB using the standard ones. Resolved from the fields of the WriteConcern class by calling the {@link WriteConcern#valueOf(String)} method. @param writeConcern the standard name of the WriteConcern @see possible options
readPreference parameter com.mongodb.ReadPreference false Sets a MongoDB {@link ReadPreference} on the Mongo connection. Read preferences set directly on the connection will be overridden by this setting.

The {@link com.mongodb.ReadPreference#valueOf(String)} utility method is used to resolve the passed {@code readPreference} value. Some examples for the possible values are {@code nearest}, {@code primary} or {@code secondary} etc. @param readPreference the name of the read preference to set

dynamicity parameter boolean false 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. @see MongoDbConstants#DATABASE @see MongoDbConstants#COLLECTION @param dynamicity true or false indicated whether target database and collection should be calculated dynamically based on Exchange properties.
writeResultAsHeader parameter boolean false In write operations, it determines whether instead of returning {@link WriteResult} as the body of the OUT message, we transfer the IN message to the OUT and attach the WriteResult as a header. @param writeResultAsHeader flag to indicate if this option is enabled
cursorRegenerationDelay parameter long false 1000 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. @param cursorRegenerationDelay delay specified in milliseconds
tailTrackIncreasingField parameter java.lang.String false 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. @param tailTrackIncreasingField
persistentTailTracking parameter boolean false 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. @param persistentTailTracking true or false
persistentId parameter java.lang.String false One tail tracking collection can host many trackers for several tailable consumers. To keep them separate, each tracker should have its own unique persistentId. @param persistentId the value of the persistent ID to use for this tailable consumer
tailTrackDb parameter java.lang.String false 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. @param tailTrackDb database name
tailTrackCollection parameter java.lang.String false Collection where tail tracking information will be persisted. If not specified, {@link MongoDbTailTrackingConfig#DEFAULT_COLLECTION} will be used by default. @param tailTrackCollection collection name
tailTrackField parameter java.lang.String false Field where the last tracked value will be placed. If not specified, {@link MongoDbTailTrackingConfig#DEFAULT_FIELD} will be used by default. @param tailTrackField field name
exchangePattern parameter org.apache.camel.ExchangePattern false InOnly InOnly
RobustInOnly
InOut
InOptionalOut
OutOnly
RobustOutOnly
OutIn
OutOptionalIn
Sets the default exchange pattern when creating an exchange
synchronous parameter boolean false false Sets whether synchronous processing should be strictly used, or Camel is allowed to use asynchronous processing (if supported).

mongodb consumer

The MongoDb consumer.