This is an automated email from the ASF dual-hosted git repository. acosentino pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/master by this push: new 70d0f43 Regen 70d0f43 is described below commit 70d0f43668fe2b78a922b705521b812a63671681 Author: Andrea Cosentino <anco...@gmail.com> AuthorDate: Mon Dec 16 10:08:49 2019 +0100 Regen --- .../dsl/MongoDbEndpointBuilderFactory.java | 98 ++++++++++++++++++++-- .../modules/ROOT/pages/mongodb-component.adoc | 6 +- .../springboot/MongoDbComponentConfiguration.java | 2 +- 3 files changed, 97 insertions(+), 9 deletions(-) diff --git a/core/camel-endpointdsl/src/main/java/org/apache/camel/builder/endpoint/dsl/MongoDbEndpointBuilderFactory.java b/core/camel-endpointdsl/src/main/java/org/apache/camel/builder/endpoint/dsl/MongoDbEndpointBuilderFactory.java index cdbd535..ad7287d 100644 --- a/core/camel-endpointdsl/src/main/java/org/apache/camel/builder/endpoint/dsl/MongoDbEndpointBuilderFactory.java +++ b/core/camel-endpointdsl/src/main/java/org/apache/camel/builder/endpoint/dsl/MongoDbEndpointBuilderFactory.java @@ -105,7 +105,7 @@ public interface MongoDbEndpointBuilderFactory { /** * Sets the Mongo instance that represents the backing connection. * - * The option is a: <code>com.mongodb.MongoClient</code> type. + * The option is a: <code>com.mongodb.client.MongoClient</code> type. * * Group: common */ @@ -118,7 +118,7 @@ public interface MongoDbEndpointBuilderFactory { * Sets the Mongo instance that represents the backing connection. * * The option will be converted to a - * <code>com.mongodb.MongoClient</code> type. + * <code>com.mongodb.client.MongoClient</code> type. * * Group: common */ @@ -512,6 +512,20 @@ public interface MongoDbEndpointBuilderFactory { return this; } /** + * Configure how MongoDB clients route read operations to the members of + * a replica set. Possible values are PRIMARY, PRIMARY_PREFERRED, + * SECONDARY, SECONDARY_PREFERRED or NEAREST. + * + * The option is a: <code>java.lang.String</code> type. + * + * Group: advanced + */ + default AdvancedMongoDbEndpointConsumerBuilder readPreference( + String readPreference) { + doSetProperty("readPreference", readPreference); + return this; + } + /** * Sets whether synchronous processing should be strictly used, or Camel * is allowed to use asynchronous processing (if supported). * @@ -538,6 +552,21 @@ public interface MongoDbEndpointBuilderFactory { return this; } /** + * Configure the connection bean with the level of acknowledgment + * requested from MongoDB for write operations to a standalone mongod, + * replicaset or cluster. Possible values are ACKNOWLEDGED, W1, W2, W3, + * UNACKNOWLEDGED, JOURNALED or MAJORITY. + * + * The option is a: <code>java.lang.String</code> type. + * + * Group: advanced + */ + default AdvancedMongoDbEndpointConsumerBuilder writeConcern( + String writeConcern) { + doSetProperty("writeConcern", writeConcern); + return this; + } + /** * 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. @@ -640,7 +669,7 @@ public interface MongoDbEndpointBuilderFactory { /** * Sets the Mongo instance that represents the backing connection. * - * The option is a: <code>com.mongodb.MongoClient</code> type. + * The option is a: <code>com.mongodb.client.MongoClient</code> type. * * Group: common */ @@ -653,7 +682,7 @@ public interface MongoDbEndpointBuilderFactory { * Sets the Mongo instance that represents the backing connection. * * The option will be converted to a - * <code>com.mongodb.MongoClient</code> type. + * <code>com.mongodb.client.MongoClient</code> type. * * Group: common */ @@ -983,6 +1012,20 @@ public interface MongoDbEndpointBuilderFactory { return this; } /** + * Configure how MongoDB clients route read operations to the members of + * a replica set. Possible values are PRIMARY, PRIMARY_PREFERRED, + * SECONDARY, SECONDARY_PREFERRED or NEAREST. + * + * The option is a: <code>java.lang.String</code> type. + * + * Group: advanced + */ + default AdvancedMongoDbEndpointProducerBuilder readPreference( + String readPreference) { + doSetProperty("readPreference", readPreference); + return this; + } + /** * Sets whether synchronous processing should be strictly used, or Camel * is allowed to use asynchronous processing (if supported). * @@ -1009,6 +1052,21 @@ public interface MongoDbEndpointBuilderFactory { return this; } /** + * Configure the connection bean with the level of acknowledgment + * requested from MongoDB for write operations to a standalone mongod, + * replicaset or cluster. Possible values are ACKNOWLEDGED, W1, W2, W3, + * UNACKNOWLEDGED, JOURNALED or MAJORITY. + * + * The option is a: <code>java.lang.String</code> type. + * + * Group: advanced + */ + default AdvancedMongoDbEndpointProducerBuilder writeConcern( + String writeConcern) { + doSetProperty("writeConcern", writeConcern); + return this; + } + /** * 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. @@ -1108,7 +1166,7 @@ public interface MongoDbEndpointBuilderFactory { /** * Sets the Mongo instance that represents the backing connection. * - * The option is a: <code>com.mongodb.MongoClient</code> type. + * The option is a: <code>com.mongodb.client.MongoClient</code> type. * * Group: common */ @@ -1120,7 +1178,7 @@ public interface MongoDbEndpointBuilderFactory { * Sets the Mongo instance that represents the backing connection. * * The option will be converted to a - * <code>com.mongodb.MongoClient</code> type. + * <code>com.mongodb.client.MongoClient</code> type. * * Group: common */ @@ -1404,6 +1462,20 @@ public interface MongoDbEndpointBuilderFactory { return this; } /** + * Configure how MongoDB clients route read operations to the members of + * a replica set. Possible values are PRIMARY, PRIMARY_PREFERRED, + * SECONDARY, SECONDARY_PREFERRED or NEAREST. + * + * The option is a: <code>java.lang.String</code> type. + * + * Group: advanced + */ + default AdvancedMongoDbEndpointBuilder readPreference( + String readPreference) { + doSetProperty("readPreference", readPreference); + return this; + } + /** * Sets whether synchronous processing should be strictly used, or Camel * is allowed to use asynchronous processing (if supported). * @@ -1428,6 +1500,20 @@ public interface MongoDbEndpointBuilderFactory { return this; } /** + * Configure the connection bean with the level of acknowledgment + * requested from MongoDB for write operations to a standalone mongod, + * replicaset or cluster. Possible values are ACKNOWLEDGED, W1, W2, W3, + * UNACKNOWLEDGED, JOURNALED or MAJORITY. + * + * The option is a: <code>java.lang.String</code> type. + * + * Group: advanced + */ + default AdvancedMongoDbEndpointBuilder writeConcern(String writeConcern) { + doSetProperty("writeConcern", writeConcern); + return this; + } + /** * 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. diff --git a/docs/components/modules/ROOT/pages/mongodb-component.adoc b/docs/components/modules/ROOT/pages/mongodb-component.adoc index 390cf4f..38f5f91 100644 --- a/docs/components/modules/ROOT/pages/mongodb-component.adoc +++ b/docs/components/modules/ROOT/pages/mongodb-component.adoc @@ -97,7 +97,7 @@ with the following path and query parameters: |=== -=== Query Parameters (24 parameters): +=== Query Parameters (26 parameters): [width="100%",cols="2,5,^1,2",options="header"] @@ -118,7 +118,9 @@ with the following path and query parameters: | *basicPropertyBinding* (advanced) | Whether the endpoint should use basic property binding (Camel 2.x) or the newer property binding with additional capabilities | false | boolean | *cursorRegenerationDelay* (advanced) | 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. | 1000 | long | *dynamicity* (advanced) | 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. | false | boolean +| *readPreference* (advanced) | Configure how MongoDB clients route read operations to the members of a replica set. Possible values are PRIMARY, PRIMARY_PREFERRED, SECONDARY, SECONDARY_PREFERRED or NEAREST | PRIMARY | String | *synchronous* (advanced) | Sets whether synchronous processing should be strictly used, or Camel is allowed to use asynchronous processing (if supported). | false | boolean +| *writeConcern* (advanced) | Configure the connection bean with the level of acknowledgment requested from MongoDB for write operations to a standalone mongod, replicaset or cluster. Possible values are ACKNOWLEDGED, W1, W2, W3, UNACKNOWLEDGED, JOURNALED or MAJORITY. | ACKNOWLEDGED | String | *writeResultAsHeader* (advanced) | 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. | false | boolean | *streamFilter* (changeStream) | Filter condition for change streams consumer. | | String | *persistentId* (tail) | One tail tracking collection can host many trackers for several tailable consumers. To keep them separate, each tracker should have its own unique persistentId. | | String @@ -156,7 +158,7 @@ The component supports 5 options, which are listed below. | *camel.component.mongodb.bridge-error-handler* | 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 or ERROR level and ignored. | false | Boolean | *camel.component.mongodb.enabled* | Whether to enable auto configuration of the mongodb component. This is enabled by default. | | Boolean | *camel.component.mongodb.lazy-start-producer* | Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed th [...] -| *camel.component.mongodb.mongo-connection* | Set a client used for connection: all endpoints generated from the component will share this connection bean. The option is a com.mongodb.MongoClient type. | | String +| *camel.component.mongodb.mongo-connection* | Set a client used for connection: all endpoints generated from the component will share this connection bean. The option is a com.mongodb.client.MongoClient type. | | String |=== // spring-boot-auto-configure options: END diff --git a/platforms/spring-boot/components-starter/camel-mongodb-starter/src/main/java/org/apache/camel/component/mongodb/springboot/MongoDbComponentConfiguration.java b/platforms/spring-boot/components-starter/camel-mongodb-starter/src/main/java/org/apache/camel/component/mongodb/springboot/MongoDbComponentConfiguration.java index 0ebbf0d..acfbef3 100644 --- a/platforms/spring-boot/components-starter/camel-mongodb-starter/src/main/java/org/apache/camel/component/mongodb/springboot/MongoDbComponentConfiguration.java +++ b/platforms/spring-boot/components-starter/camel-mongodb-starter/src/main/java/org/apache/camel/component/mongodb/springboot/MongoDbComponentConfiguration.java @@ -39,7 +39,7 @@ public class MongoDbComponentConfiguration /** * Set a client used for connection: all endpoints generated from the * component will share this connection bean. The option is a - * com.mongodb.MongoClient type. + * com.mongodb.client.MongoClient type. */ private String mongoConnection; /**