Endpoint options - 6.3

Talend ESB Mediation Developer Guide

EnrichVersion
6.3
EnrichProdName
Talend Data Fabric
Talend Data Services Platform
Talend ESB
Talend MDM Platform
Talend Open Studio for ESB
Talend Real-Time Big Data Platform
task
Design and Development
EnrichPlatform
Talend ESB

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).

Name

Default Value

Description

Producer

Tailable Cursor Consumer

database

none

Required. 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 CamelMongoDbDatabase header is set.

collection

none

Required. The name of the collection (within the specified database) to which this endpoint will be bound. All operations will be executed against this database unless dynamicity is enabled and the CamelMongoDbDatabase header is set.

collectionIndex

none

Camel 2.12: An optional single field index or compound index to create when inserting new collections.

 

operation

none

Required for producers. The id of the operation this endpoint will execute. Pick from the following:

  • Query operations: findById, findOneByQuery, findAll, count

  • Write operations: insert, save, update

  • Delete operations: remove

  • Other operations: getDbStats, getColStats, aggregate

 

createCollection

true

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 false and the collection doesn't exist, an initialisation exception will be thrown.

 

invokeGetLastError

false (behaviour may be inherited from connections WriteConcern)

Instructs the MongoDB Java driver to invoke getLastError() 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 getLastError() on the WriteResult object returned or by setting the appropriate WriteConcern. If the backend operation has not finished yet, the client will block until the result is available. Setting this option to true will make the endpoint behave synchronously and return an Exception if the underlying operation failed.

 

writeConcern

none (driver's default)

Set a WriteConcern on the operation out of MongoDB's parameterised values. See WriteConcern.valueOf(String).

 

writeConcernRef

none

Sets a custom WriteConcern that exists in the Registry. Specify the bean name.

 

readPreference

none

Sets a ReadPreference on the connection. Accepted values: the name of any inner subclass of ReadPreference. For example: PrimaryReadPreference, SecondaryReadPreference, TaggedReadPreference.

 

dynamicity

false

If set to true, the endpoint will inspect the CamelMongoDbDatabase and CamelMongoDbCollection 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.

 

writeResultAsHeader

false

Available as of Camel 2.10.3 and 2.11: 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 CamelMongoWriteResult header (constant MongoDb

Constants.WRITERESULT).

 

persistentTail

Tracking

false

Enables or disables persistent tail tracking for Tailable Cursor consumers. See below for more information.

 

persistentId

none

Required if persistent tail tracking is enabled. The id of this persistent tail tracker, to separate its records from the rest on the tail-tracking collection.

 

tailTracking

IncreasingField

none

Required if persistent tail tracking is enabled. 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 (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.

 

cursorRegeneration

Delay

1000ms

Establishes how long the endpoint will wait to regenerate the cursor after it has been killed by the MongoDB server (normal behaviour).

 

tailTrackDb

same as endpoint's

Database on which the persistent tail tracker will store its runtime information.

 

tailTrackCollection

camelTailTracking

Collection on which the persistent tail tracker will store its runtime information.

 

tailTrackField

lastTrackingValue

Field in which the persistent tail tracker will store the last tracked value.