You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ac...@apache.org on 2020/11/13 12:00:16 UTC

[camel] branch master updated (33058eb -> ec6b1ab)

This is an automated email from the ASF dual-hosted git repository.

acosentino pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git.


    from 33058eb  Regen for commit 993bafc49e100eb72bc016f12d3cff3fcf48875b
     new 858ba2f  CAMEL-15836 - Camel-AWS2-DDB: enable autowire on the DynamoDb client
     new 6326f9c  CAMEL-15836 - Camel-AWS2-DDB: enable autowire on the DynamoDb client, fixed tests
     new 9d8a890  CAMEL-15836 - Camel-AWS2-DDB: enable autowire on the DynamoDb client, renamed autodiscover test
     new 04e8741  CAMEL-15836 - Camel-AWS2-DDB: enable autowire on the DynamoDb client, fixed tests
     new 11c2f0a6 CAMEL-15836 - Camel-AWS2-DDB: enable autowire on the DynamoDb client, catalog regen
     new 49de3f5  CAMEL-15836 - Camel-AWS2-DDB: enable autowire on the DynamoDb client, added a note in migration guide
     new f3553a7  CAMEL-15836 - Camel-AWS2-DDB: enable autowire on the DynamoDbStreams client
     new 66653a9  CAMEL-15836 - Camel-AWS2-DDB: enable autowire on the DynamoDbStreams client, regen component
     new e7e5ccb  CAMEL-15836 - Camel-AWS2-DDB: enable autowire on the DynamoDbStreams client, regen catalog
     new ec6b1ab  CAMEL-15836 - Camel-AWS2-DDB: enable autowire on the DynamoDbStreams client, added a note in migration guide

The 10 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../apache/camel/catalog/components/aws2-ddb.json  |  6 ++---
 .../camel/catalog/components/aws2-ddbstream.json   |  6 ++---
 .../camel/catalog/docs/aws2-ddb-component.adoc     | 10 +++-----
 .../catalog/docs/aws2-ddbstream-component.adoc     | 10 +++-----
 .../aws2/ddb/Ddb2ComponentConfigurer.java          | 11 ++++----
 .../component/aws2/ddb/Ddb2EndpointConfigurer.java | 11 ++++----
 .../component/aws2/ddb/Ddb2EndpointUriFactory.java |  3 +--
 .../ddbstream/Ddb2StreamComponentConfigurer.java   | 11 ++++----
 .../ddbstream/Ddb2StreamEndpointConfigurer.java    | 11 ++++----
 .../ddbstream/Ddb2StreamEndpointUriFactory.java    |  3 +--
 .../apache/camel/component/aws2/ddb/aws2-ddb.json  |  6 ++---
 .../component/aws2/ddbstream/aws2-ddbstream.json   |  6 ++---
 .../src/main/docs/aws2-ddb-component.adoc          | 10 +++-----
 .../src/main/docs/aws2-ddbstream-component.adoc    | 10 +++-----
 .../camel/component/aws2/ddb/Ddb2Component.java    | 21 ---------------
 .../component/aws2/ddb/Ddb2Configuration.java      | 15 +----------
 .../aws2/ddbstream/Ddb2StreamComponent.java        | 21 ---------------
 .../aws2/ddbstream/Ddb2StreamConfiguration.java    | 13 +---------
 .../aws2/ddb/DdbComponentRegistryClientTest.java   | 15 +----------
 .../dsl/Aws2DdbComponentBuilderFactory.java        | 16 ------------
 .../dsl/Aws2DdbstreamComponentBuilderFactory.java  | 16 ------------
 .../endpoint/dsl/Ddb2EndpointBuilderFactory.java   | 29 ---------------------
 .../dsl/Ddb2StreamEndpointBuilderFactory.java      | 30 ----------------------
 .../modules/ROOT/pages/aws2-ddb-component.adoc     | 10 +++-----
 .../ROOT/pages/aws2-ddbstream-component.adoc       | 10 +++-----
 .../ROOT/pages/camel-3x-upgrade-guide-3_7.adoc     |  8 ++++++
 26 files changed, 65 insertions(+), 253 deletions(-)


[camel] 08/10: CAMEL-15836 - Camel-AWS2-DDB: enable autowire on the DynamoDbStreams client, regen component

Posted by ac...@apache.org.
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

commit 66653a9d3a14195c4ea1bca472dded63f3a8d7a2
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Fri Nov 13 12:52:37 2020 +0100

    CAMEL-15836 - Camel-AWS2-DDB: enable autowire on the DynamoDbStreams client, regen component
---
 .../catalog/docs/aws2-ddbstream-component.adoc     | 10 +++-----
 .../ddbstream/Ddb2StreamComponentConfigurer.java   | 11 ++++----
 .../ddbstream/Ddb2StreamEndpointConfigurer.java    | 11 ++++----
 .../ddbstream/Ddb2StreamEndpointUriFactory.java    |  3 +--
 .../component/aws2/ddbstream/aws2-ddbstream.json   |  6 ++---
 .../src/main/docs/aws2-ddbstream-component.adoc    | 10 +++-----
 .../aws2/ddbstream/Ddb2StreamComponent.java        |  3 ---
 .../dsl/Aws2DdbstreamComponentBuilderFactory.java  | 16 ------------
 .../dsl/Ddb2StreamEndpointBuilderFactory.java      | 30 ----------------------
 .../ROOT/pages/aws2-ddbstream-component.adoc       | 10 +++-----
 10 files changed, 25 insertions(+), 85 deletions(-)

diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/aws2-ddbstream-component.adoc b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/aws2-ddbstream-component.adoc
index 6f4ee93..12501ff 100644
--- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/aws2-ddbstream-component.adoc
+++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/aws2-ddbstream-component.adoc
@@ -43,15 +43,14 @@ The stream needs to be created prior to it being used. +
 
 
 // component options: START
-The AWS 2 DynamoDB Streams component supports 15 options, which are listed below.
+The AWS 2 DynamoDB Streams component supports 14 options, which are listed below.
 
 
 
 [width="100%",cols="2,5,^1,2",options="header"]
 |===
 | Name | Description | Default | Type
-| *autoDiscoverClient* (common) | Setting the autoDiscoverClient mechanism, if true, the component will look for a client instance in the registry automatically otherwise it will skip that checking | true | boolean
-| *amazonDynamoDbStreamsClient* (consumer) | Amazon DynamoDB client to use for all requests for this endpoint |  | DynamoDbStreamsClient
+| *amazonDynamoDbStreamsClient* (consumer) | *Autowired* Amazon DynamoDB client to use for all requests for this endpoint |  | DynamoDbStreamsClient
 | *bridgeErrorHandler* (consumer) | 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
 | *configuration* (consumer) | The component configuration |  | Ddb2StreamConfiguration
 | *iteratorType* (consumer) | Defines where in the DynaboDB stream to start getting records. Note that using TRIM_HORIZON can cause a significant delay before the stream has caught up to real-time. if {AT,AFTER}_SEQUENCE_NUMBER are used, then a sequenceNumberProvider MUST be supplied. There are 5 enums and the value can be one of: TRIM_HORIZON, LATEST, AT_SEQUENCE_NUMBER, AFTER_SEQUENCE_NUMBER, null | LATEST | ShardIteratorType
@@ -92,14 +91,13 @@ with the following path and query parameters:
 |===
 
 
-=== Query Parameters (32 parameters):
+=== Query Parameters (31 parameters):
 
 
 [width="100%",cols="2,5,^1,2",options="header"]
 |===
 | Name | Description | Default | Type
-| *autoDiscoverClient* (common) | Setting the autoDiscoverClient mechanism, if true, the component will look for a client instance in the registry automatically otherwise it will skip that checking | true | boolean
-| *amazonDynamoDbStreamsClient* (consumer) | Amazon DynamoDB client to use for all requests for this endpoint |  | DynamoDbStreamsClient
+| *amazonDynamoDbStreamsClient* (consumer) | *Autowired* Amazon DynamoDB client to use for all requests for this endpoint |  | DynamoDbStreamsClient
 | *bridgeErrorHandler* (consumer) | 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
 | *iteratorType* (consumer) | Defines where in the DynaboDB stream to start getting records. Note that using TRIM_HORIZON can cause a significant delay before the stream has caught up to real-time. if {AT,AFTER}_SEQUENCE_NUMBER are used, then a sequenceNumberProvider MUST be supplied. There are 5 enums and the value can be one of: TRIM_HORIZON, LATEST, AT_SEQUENCE_NUMBER, AFTER_SEQUENCE_NUMBER, null | LATEST | ShardIteratorType
 | *maxResultsPerRequest* (consumer) | Maximum number of records that will be fetched in each poll |  | int
diff --git a/components/camel-aws2-ddb/src/generated/java/org/apache/camel/component/aws2/ddbstream/Ddb2StreamComponentConfigurer.java b/components/camel-aws2-ddb/src/generated/java/org/apache/camel/component/aws2/ddbstream/Ddb2StreamComponentConfigurer.java
index c90c291..5039820 100644
--- a/components/camel-aws2-ddb/src/generated/java/org/apache/camel/component/aws2/ddbstream/Ddb2StreamComponentConfigurer.java
+++ b/components/camel-aws2-ddb/src/generated/java/org/apache/camel/component/aws2/ddbstream/Ddb2StreamComponentConfigurer.java
@@ -32,8 +32,6 @@ public class Ddb2StreamComponentConfigurer extends PropertyConfigurerSupport imp
         case "accessKey": getOrCreateConfiguration(target).setAccessKey(property(camelContext, java.lang.String.class, value)); return true;
         case "amazondynamodbstreamsclient":
         case "amazonDynamoDbStreamsClient": getOrCreateConfiguration(target).setAmazonDynamoDbStreamsClient(property(camelContext, software.amazon.awssdk.services.dynamodb.streams.DynamoDbStreamsClient.class, value)); return true;
-        case "autodiscoverclient":
-        case "autoDiscoverClient": getOrCreateConfiguration(target).setAutoDiscoverClient(property(camelContext, boolean.class, value)); return true;
         case "autowiredenabled":
         case "autowiredEnabled": target.setAutowiredEnabled(property(camelContext, boolean.class, value)); return true;
         case "bridgeerrorhandler":
@@ -61,14 +59,17 @@ public class Ddb2StreamComponentConfigurer extends PropertyConfigurerSupport imp
     }
 
     @Override
+    public String[] getAutowiredNames() {
+        return new String[]{"amazonDynamoDbStreamsClient"};
+    }
+
+    @Override
     public Class<?> getOptionType(String name, boolean ignoreCase) {
         switch (ignoreCase ? name.toLowerCase() : name) {
         case "accesskey":
         case "accessKey": return java.lang.String.class;
         case "amazondynamodbstreamsclient":
         case "amazonDynamoDbStreamsClient": return software.amazon.awssdk.services.dynamodb.streams.DynamoDbStreamsClient.class;
-        case "autodiscoverclient":
-        case "autoDiscoverClient": return boolean.class;
         case "autowiredenabled":
         case "autowiredEnabled": return boolean.class;
         case "bridgeerrorhandler":
@@ -103,8 +104,6 @@ public class Ddb2StreamComponentConfigurer extends PropertyConfigurerSupport imp
         case "accessKey": return getOrCreateConfiguration(target).getAccessKey();
         case "amazondynamodbstreamsclient":
         case "amazonDynamoDbStreamsClient": return getOrCreateConfiguration(target).getAmazonDynamoDbStreamsClient();
-        case "autodiscoverclient":
-        case "autoDiscoverClient": return getOrCreateConfiguration(target).isAutoDiscoverClient();
         case "autowiredenabled":
         case "autowiredEnabled": return target.isAutowiredEnabled();
         case "bridgeerrorhandler":
diff --git a/components/camel-aws2-ddb/src/generated/java/org/apache/camel/component/aws2/ddbstream/Ddb2StreamEndpointConfigurer.java b/components/camel-aws2-ddb/src/generated/java/org/apache/camel/component/aws2/ddbstream/Ddb2StreamEndpointConfigurer.java
index 4b99429..214267f 100644
--- a/components/camel-aws2-ddb/src/generated/java/org/apache/camel/component/aws2/ddbstream/Ddb2StreamEndpointConfigurer.java
+++ b/components/camel-aws2-ddb/src/generated/java/org/apache/camel/component/aws2/ddbstream/Ddb2StreamEndpointConfigurer.java
@@ -25,8 +25,6 @@ public class Ddb2StreamEndpointConfigurer extends PropertyConfigurerSupport impl
         case "accessKey": target.getConfiguration().setAccessKey(property(camelContext, java.lang.String.class, value)); return true;
         case "amazondynamodbstreamsclient":
         case "amazonDynamoDbStreamsClient": target.getConfiguration().setAmazonDynamoDbStreamsClient(property(camelContext, software.amazon.awssdk.services.dynamodb.streams.DynamoDbStreamsClient.class, value)); return true;
-        case "autodiscoverclient":
-        case "autoDiscoverClient": target.getConfiguration().setAutoDiscoverClient(property(camelContext, boolean.class, value)); return true;
         case "backofferrorthreshold":
         case "backoffErrorThreshold": target.setBackoffErrorThreshold(property(camelContext, int.class, value)); return true;
         case "backoffidlethreshold":
@@ -85,14 +83,17 @@ public class Ddb2StreamEndpointConfigurer extends PropertyConfigurerSupport impl
     }
 
     @Override
+    public String[] getAutowiredNames() {
+        return new String[]{"amazonDynamoDbStreamsClient"};
+    }
+
+    @Override
     public Class<?> getOptionType(String name, boolean ignoreCase) {
         switch (ignoreCase ? name.toLowerCase() : name) {
         case "accesskey":
         case "accessKey": return java.lang.String.class;
         case "amazondynamodbstreamsclient":
         case "amazonDynamoDbStreamsClient": return software.amazon.awssdk.services.dynamodb.streams.DynamoDbStreamsClient.class;
-        case "autodiscoverclient":
-        case "autoDiscoverClient": return boolean.class;
         case "backofferrorthreshold":
         case "backoffErrorThreshold": return int.class;
         case "backoffidlethreshold":
@@ -158,8 +159,6 @@ public class Ddb2StreamEndpointConfigurer extends PropertyConfigurerSupport impl
         case "accessKey": return target.getConfiguration().getAccessKey();
         case "amazondynamodbstreamsclient":
         case "amazonDynamoDbStreamsClient": return target.getConfiguration().getAmazonDynamoDbStreamsClient();
-        case "autodiscoverclient":
-        case "autoDiscoverClient": return target.getConfiguration().isAutoDiscoverClient();
         case "backofferrorthreshold":
         case "backoffErrorThreshold": return target.getBackoffErrorThreshold();
         case "backoffidlethreshold":
diff --git a/components/camel-aws2-ddb/src/generated/java/org/apache/camel/component/aws2/ddbstream/Ddb2StreamEndpointUriFactory.java b/components/camel-aws2-ddb/src/generated/java/org/apache/camel/component/aws2/ddbstream/Ddb2StreamEndpointUriFactory.java
index 1dda247..ece841f 100644
--- a/components/camel-aws2-ddb/src/generated/java/org/apache/camel/component/aws2/ddbstream/Ddb2StreamEndpointUriFactory.java
+++ b/components/camel-aws2-ddb/src/generated/java/org/apache/camel/component/aws2/ddbstream/Ddb2StreamEndpointUriFactory.java
@@ -20,7 +20,7 @@ public class Ddb2StreamEndpointUriFactory extends org.apache.camel.support.compo
     private static final Set<String> PROPERTY_NAMES;
     private static final Set<String> SECRET_PROPERTY_NAMES;
     static {
-        Set<String> props = new HashSet<>(33);
+        Set<String> props = new HashSet<>(32);
         props.add("backoffMultiplier");
         props.add("synchronous");
         props.add("initialDelay");
@@ -36,7 +36,6 @@ public class Ddb2StreamEndpointUriFactory extends org.apache.camel.support.compo
         props.add("scheduledExecutorService");
         props.add("repeatCount");
         props.add("timeUnit");
-        props.add("autoDiscoverClient");
         props.add("proxyProtocol");
         props.add("secretKey");
         props.add("iteratorType");
diff --git a/components/camel-aws2-ddb/src/generated/resources/org/apache/camel/component/aws2/ddbstream/aws2-ddbstream.json b/components/camel-aws2-ddb/src/generated/resources/org/apache/camel/component/aws2/ddbstream/aws2-ddbstream.json
index 32f05c8..6bb93ea 100644
--- a/components/camel-aws2-ddb/src/generated/resources/org/apache/camel/component/aws2/ddbstream/aws2-ddbstream.json
+++ b/components/camel-aws2-ddb/src/generated/resources/org/apache/camel/component/aws2/ddbstream/aws2-ddbstream.json
@@ -22,8 +22,7 @@
     "lenientProperties": false
   },
   "componentProperties": {
-    "autoDiscoverClient": { "kind": "property", "displayName": "Auto Discover Client", "group": "common", "label": "common", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "configurationClass": "org.apache.camel.component.aws2.ddbstream.Ddb2StreamConfiguration", "configurationField": "configuration", "description": "Setting the autoDiscoverClient mechanism, if true, the component will look for a [...]
-    "amazonDynamoDbStreamsClient": { "kind": "property", "displayName": "Amazon Dynamo Db Streams Client", "group": "consumer", "label": "consumer", "required": false, "type": "object", "javaType": "software.amazon.awssdk.services.dynamodb.streams.DynamoDbStreamsClient", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.ddbstream.Ddb2StreamConfiguration", "configurationField": "configuration", "description": "Amazon DynamoDB  [...]
+    "amazonDynamoDbStreamsClient": { "kind": "property", "displayName": "Amazon Dynamo Db Streams Client", "group": "consumer", "label": "consumer", "required": false, "type": "object", "javaType": "software.amazon.awssdk.services.dynamodb.streams.DynamoDbStreamsClient", "deprecated": false, "deprecationNote": "", "autowired": true, "secret": false, "configurationClass": "org.apache.camel.component.aws2.ddbstream.Ddb2StreamConfiguration", "configurationField": "configuration", "descripti [...]
     "bridgeErrorHandler": { "kind": "property", "displayName": "Bridge Error Handler", "group": "consumer", "label": "consumer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "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 me [...]
     "configuration": { "kind": "property", "displayName": "Configuration", "group": "consumer", "label": "", "required": false, "type": "object", "javaType": "org.apache.camel.component.aws2.ddbstream.Ddb2StreamConfiguration", "deprecated": false, "autowired": false, "secret": false, "description": "The component configuration" },
     "iteratorType": { "kind": "property", "displayName": "Iterator Type", "group": "consumer", "label": "consumer", "required": false, "type": "object", "javaType": "software.amazon.awssdk.services.dynamodb.model.ShardIteratorType", "enum": [ "TRIM_HORIZON", "LATEST", "AT_SEQUENCE_NUMBER", "AFTER_SEQUENCE_NUMBER", "null" ], "deprecated": false, "autowired": false, "secret": false, "defaultValue": "LATEST", "configurationClass": "org.apache.camel.component.aws2.ddbstream.Ddb2StreamConfigu [...]
@@ -40,8 +39,7 @@
   },
   "properties": {
     "tableName": { "kind": "path", "displayName": "Table Name", "group": "consumer", "label": "consumer", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.ddbstream.Ddb2StreamConfiguration", "configurationField": "configuration", "description": "Name of the dynamodb table" },
-    "autoDiscoverClient": { "kind": "parameter", "displayName": "Auto Discover Client", "group": "common", "label": "common", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "configurationClass": "org.apache.camel.component.aws2.ddbstream.Ddb2StreamConfiguration", "configurationField": "configuration", "description": "Setting the autoDiscoverClient mechanism, if true, the component will look for  [...]
-    "amazonDynamoDbStreamsClient": { "kind": "parameter", "displayName": "Amazon Dynamo Db Streams Client", "group": "consumer", "label": "consumer", "required": false, "type": "object", "javaType": "software.amazon.awssdk.services.dynamodb.streams.DynamoDbStreamsClient", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.ddbstream.Ddb2StreamConfiguration", "configurationField": "configuration", "description": "Amazon DynamoDB [...]
+    "amazonDynamoDbStreamsClient": { "kind": "parameter", "displayName": "Amazon Dynamo Db Streams Client", "group": "consumer", "label": "consumer", "required": false, "type": "object", "javaType": "software.amazon.awssdk.services.dynamodb.streams.DynamoDbStreamsClient", "deprecated": false, "deprecationNote": "", "autowired": true, "secret": false, "configurationClass": "org.apache.camel.component.aws2.ddbstream.Ddb2StreamConfiguration", "configurationField": "configuration", "descript [...]
     "bridgeErrorHandler": { "kind": "parameter", "displayName": "Bridge Error Handler", "group": "consumer", "label": "consumer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "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 m [...]
     "iteratorType": { "kind": "parameter", "displayName": "Iterator Type", "group": "consumer", "label": "consumer", "required": false, "type": "object", "javaType": "software.amazon.awssdk.services.dynamodb.model.ShardIteratorType", "enum": [ "TRIM_HORIZON", "LATEST", "AT_SEQUENCE_NUMBER", "AFTER_SEQUENCE_NUMBER", "null" ], "deprecated": false, "autowired": false, "secret": false, "defaultValue": "LATEST", "configurationClass": "org.apache.camel.component.aws2.ddbstream.Ddb2StreamConfig [...]
     "maxResultsPerRequest": { "kind": "parameter", "displayName": "Max Results Per Request", "group": "consumer", "label": "consumer", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.ddbstream.Ddb2StreamConfiguration", "configurationField": "configuration", "description": "Maximum number of records that will be fetched in each poll" },
diff --git a/components/camel-aws2-ddb/src/main/docs/aws2-ddbstream-component.adoc b/components/camel-aws2-ddb/src/main/docs/aws2-ddbstream-component.adoc
index 6f4ee93..12501ff 100644
--- a/components/camel-aws2-ddb/src/main/docs/aws2-ddbstream-component.adoc
+++ b/components/camel-aws2-ddb/src/main/docs/aws2-ddbstream-component.adoc
@@ -43,15 +43,14 @@ The stream needs to be created prior to it being used. +
 
 
 // component options: START
-The AWS 2 DynamoDB Streams component supports 15 options, which are listed below.
+The AWS 2 DynamoDB Streams component supports 14 options, which are listed below.
 
 
 
 [width="100%",cols="2,5,^1,2",options="header"]
 |===
 | Name | Description | Default | Type
-| *autoDiscoverClient* (common) | Setting the autoDiscoverClient mechanism, if true, the component will look for a client instance in the registry automatically otherwise it will skip that checking | true | boolean
-| *amazonDynamoDbStreamsClient* (consumer) | Amazon DynamoDB client to use for all requests for this endpoint |  | DynamoDbStreamsClient
+| *amazonDynamoDbStreamsClient* (consumer) | *Autowired* Amazon DynamoDB client to use for all requests for this endpoint |  | DynamoDbStreamsClient
 | *bridgeErrorHandler* (consumer) | 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
 | *configuration* (consumer) | The component configuration |  | Ddb2StreamConfiguration
 | *iteratorType* (consumer) | Defines where in the DynaboDB stream to start getting records. Note that using TRIM_HORIZON can cause a significant delay before the stream has caught up to real-time. if {AT,AFTER}_SEQUENCE_NUMBER are used, then a sequenceNumberProvider MUST be supplied. There are 5 enums and the value can be one of: TRIM_HORIZON, LATEST, AT_SEQUENCE_NUMBER, AFTER_SEQUENCE_NUMBER, null | LATEST | ShardIteratorType
@@ -92,14 +91,13 @@ with the following path and query parameters:
 |===
 
 
-=== Query Parameters (32 parameters):
+=== Query Parameters (31 parameters):
 
 
 [width="100%",cols="2,5,^1,2",options="header"]
 |===
 | Name | Description | Default | Type
-| *autoDiscoverClient* (common) | Setting the autoDiscoverClient mechanism, if true, the component will look for a client instance in the registry automatically otherwise it will skip that checking | true | boolean
-| *amazonDynamoDbStreamsClient* (consumer) | Amazon DynamoDB client to use for all requests for this endpoint |  | DynamoDbStreamsClient
+| *amazonDynamoDbStreamsClient* (consumer) | *Autowired* Amazon DynamoDB client to use for all requests for this endpoint |  | DynamoDbStreamsClient
 | *bridgeErrorHandler* (consumer) | 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
 | *iteratorType* (consumer) | Defines where in the DynaboDB stream to start getting records. Note that using TRIM_HORIZON can cause a significant delay before the stream has caught up to real-time. if {AT,AFTER}_SEQUENCE_NUMBER are used, then a sequenceNumberProvider MUST be supplied. There are 5 enums and the value can be one of: TRIM_HORIZON, LATEST, AT_SEQUENCE_NUMBER, AFTER_SEQUENCE_NUMBER, null | LATEST | ShardIteratorType
 | *maxResultsPerRequest* (consumer) | Maximum number of records that will be fetched in each poll |  | int
diff --git a/components/camel-aws2-ddb/src/main/java/org/apache/camel/component/aws2/ddbstream/Ddb2StreamComponent.java b/components/camel-aws2-ddb/src/main/java/org/apache/camel/component/aws2/ddbstream/Ddb2StreamComponent.java
index c09427a..c1ca682 100644
--- a/components/camel-aws2-ddb/src/main/java/org/apache/camel/component/aws2/ddbstream/Ddb2StreamComponent.java
+++ b/components/camel-aws2-ddb/src/main/java/org/apache/camel/component/aws2/ddbstream/Ddb2StreamComponent.java
@@ -17,17 +17,14 @@
 package org.apache.camel.component.aws2.ddbstream;
 
 import java.util.Map;
-import java.util.Set;
 
 import org.apache.camel.CamelContext;
 import org.apache.camel.Endpoint;
 import org.apache.camel.spi.Metadata;
 import org.apache.camel.spi.annotations.Component;
 import org.apache.camel.support.DefaultComponent;
-import org.apache.camel.util.ObjectHelper;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
-import software.amazon.awssdk.services.dynamodb.streams.DynamoDbStreamsClient;
 
 @Component("aws2-ddbstream")
 public class Ddb2StreamComponent extends DefaultComponent {
diff --git a/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/Aws2DdbstreamComponentBuilderFactory.java b/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/Aws2DdbstreamComponentBuilderFactory.java
index caeea2e..60e20d1 100644
--- a/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/Aws2DdbstreamComponentBuilderFactory.java
+++ b/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/Aws2DdbstreamComponentBuilderFactory.java
@@ -50,21 +50,6 @@ public interface Aws2DdbstreamComponentBuilderFactory {
             extends
                 ComponentBuilder<Ddb2StreamComponent> {
         /**
-         * Setting the autoDiscoverClient mechanism, if true, the component will
-         * look for a client instance in the registry automatically otherwise it
-         * will skip that checking.
-         * 
-         * The option is a: <code>boolean</code> type.
-         * 
-         * Default: true
-         * Group: common
-         */
-        default Aws2DdbstreamComponentBuilder autoDiscoverClient(
-                boolean autoDiscoverClient) {
-            doSetProperty("autoDiscoverClient", autoDiscoverClient);
-            return this;
-        }
-        /**
          * Amazon DynamoDB client to use for all requests for this endpoint.
          * 
          * The option is a:
@@ -282,7 +267,6 @@ public interface Aws2DdbstreamComponentBuilderFactory {
                 String name,
                 Object value) {
             switch (name) {
-            case "autoDiscoverClient": getOrCreateConfiguration((Ddb2StreamComponent) component).setAutoDiscoverClient((boolean) value); return true;
             case "amazonDynamoDbStreamsClient": getOrCreateConfiguration((Ddb2StreamComponent) component).setAmazonDynamoDbStreamsClient((software.amazon.awssdk.services.dynamodb.streams.DynamoDbStreamsClient) value); return true;
             case "bridgeErrorHandler": ((Ddb2StreamComponent) component).setBridgeErrorHandler((boolean) value); return true;
             case "configuration": ((Ddb2StreamComponent) component).setConfiguration((org.apache.camel.component.aws2.ddbstream.Ddb2StreamConfiguration) value); return true;
diff --git a/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/Ddb2StreamEndpointBuilderFactory.java b/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/Ddb2StreamEndpointBuilderFactory.java
index 602d99d..7c29cc8 100644
--- a/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/Ddb2StreamEndpointBuilderFactory.java
+++ b/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/Ddb2StreamEndpointBuilderFactory.java
@@ -47,36 +47,6 @@ public interface Ddb2StreamEndpointBuilderFactory {
             return (AdvancedDdb2StreamEndpointBuilder) this;
         }
         /**
-         * Setting the autoDiscoverClient mechanism, if true, the component will
-         * look for a client instance in the registry automatically otherwise it
-         * will skip that checking.
-         * 
-         * The option is a: <code>boolean</code> type.
-         * 
-         * Default: true
-         * Group: common
-         */
-        default Ddb2StreamEndpointBuilder autoDiscoverClient(
-                boolean autoDiscoverClient) {
-            doSetProperty("autoDiscoverClient", autoDiscoverClient);
-            return this;
-        }
-        /**
-         * Setting the autoDiscoverClient mechanism, if true, the component will
-         * look for a client instance in the registry automatically otherwise it
-         * will skip that checking.
-         * 
-         * The option will be converted to a <code>boolean</code> type.
-         * 
-         * Default: true
-         * Group: common
-         */
-        default Ddb2StreamEndpointBuilder autoDiscoverClient(
-                String autoDiscoverClient) {
-            doSetProperty("autoDiscoverClient", autoDiscoverClient);
-            return this;
-        }
-        /**
          * Amazon DynamoDB client to use for all requests for this endpoint.
          * 
          * The option is a:
diff --git a/docs/components/modules/ROOT/pages/aws2-ddbstream-component.adoc b/docs/components/modules/ROOT/pages/aws2-ddbstream-component.adoc
index 9efe3a8..9c3061a 100644
--- a/docs/components/modules/ROOT/pages/aws2-ddbstream-component.adoc
+++ b/docs/components/modules/ROOT/pages/aws2-ddbstream-component.adoc
@@ -45,15 +45,14 @@ The stream needs to be created prior to it being used. +
 
 
 // component options: START
-The AWS 2 DynamoDB Streams component supports 15 options, which are listed below.
+The AWS 2 DynamoDB Streams component supports 14 options, which are listed below.
 
 
 
 [width="100%",cols="2,5,^1,2",options="header"]
 |===
 | Name | Description | Default | Type
-| *autoDiscoverClient* (common) | Setting the autoDiscoverClient mechanism, if true, the component will look for a client instance in the registry automatically otherwise it will skip that checking | true | boolean
-| *amazonDynamoDbStreamsClient* (consumer) | Amazon DynamoDB client to use for all requests for this endpoint |  | DynamoDbStreamsClient
+| *amazonDynamoDbStreamsClient* (consumer) | *Autowired* Amazon DynamoDB client to use for all requests for this endpoint |  | DynamoDbStreamsClient
 | *bridgeErrorHandler* (consumer) | 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
 | *configuration* (consumer) | The component configuration |  | Ddb2StreamConfiguration
 | *iteratorType* (consumer) | Defines where in the DynaboDB stream to start getting records. Note that using TRIM_HORIZON can cause a significant delay before the stream has caught up to real-time. if {AT,AFTER}_SEQUENCE_NUMBER are used, then a sequenceNumberProvider MUST be supplied. There are 5 enums and the value can be one of: TRIM_HORIZON, LATEST, AT_SEQUENCE_NUMBER, AFTER_SEQUENCE_NUMBER, null | LATEST | ShardIteratorType
@@ -94,14 +93,13 @@ with the following path and query parameters:
 |===
 
 
-=== Query Parameters (32 parameters):
+=== Query Parameters (31 parameters):
 
 
 [width="100%",cols="2,5,^1,2",options="header"]
 |===
 | Name | Description | Default | Type
-| *autoDiscoverClient* (common) | Setting the autoDiscoverClient mechanism, if true, the component will look for a client instance in the registry automatically otherwise it will skip that checking | true | boolean
-| *amazonDynamoDbStreamsClient* (consumer) | Amazon DynamoDB client to use for all requests for this endpoint |  | DynamoDbStreamsClient
+| *amazonDynamoDbStreamsClient* (consumer) | *Autowired* Amazon DynamoDB client to use for all requests for this endpoint |  | DynamoDbStreamsClient
 | *bridgeErrorHandler* (consumer) | 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
 | *iteratorType* (consumer) | Defines where in the DynaboDB stream to start getting records. Note that using TRIM_HORIZON can cause a significant delay before the stream has caught up to real-time. if {AT,AFTER}_SEQUENCE_NUMBER are used, then a sequenceNumberProvider MUST be supplied. There are 5 enums and the value can be one of: TRIM_HORIZON, LATEST, AT_SEQUENCE_NUMBER, AFTER_SEQUENCE_NUMBER, null | LATEST | ShardIteratorType
 | *maxResultsPerRequest* (consumer) | Maximum number of records that will be fetched in each poll |  | int


[camel] 02/10: CAMEL-15836 - Camel-AWS2-DDB: enable autowire on the DynamoDb client, fixed tests

Posted by ac...@apache.org.
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

commit 6326f9c4e9da6aa642863f6039a0da4a0eb5e6e1
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Fri Nov 13 11:51:05 2020 +0100

    CAMEL-15836 - Camel-AWS2-DDB: enable autowire on the DynamoDb client, fixed tests
---
 .../camel/catalog/docs/aws2-ddb-component.adoc     | 10 +++-----
 .../aws2/ddb/Ddb2ComponentConfigurer.java          | 11 ++++----
 .../component/aws2/ddb/Ddb2EndpointConfigurer.java | 11 ++++----
 .../component/aws2/ddb/Ddb2EndpointUriFactory.java |  3 +--
 .../apache/camel/component/aws2/ddb/aws2-ddb.json  |  6 ++---
 .../src/main/docs/aws2-ddb-component.adoc          | 10 +++-----
 .../camel/component/aws2/ddb/Ddb2Component.java    |  3 ---
 .../aws2/ddb/DdbComponentRegistryClientTest.java   | 12 ---------
 .../dsl/Aws2DdbComponentBuilderFactory.java        | 16 ------------
 .../endpoint/dsl/Ddb2EndpointBuilderFactory.java   | 29 ----------------------
 .../modules/ROOT/pages/aws2-ddb-component.adoc     | 10 +++-----
 11 files changed, 25 insertions(+), 96 deletions(-)

diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/aws2-ddb-component.adoc b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/aws2-ddb-component.adoc
index efb68ec..d88aec7 100644
--- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/aws2-ddb-component.adoc
+++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/aws2-ddb-component.adoc
@@ -42,15 +42,14 @@ You can append query options to the URI in the following format,
 
 
 // component options: START
-The AWS 2 DynamoDB component supports 18 options, which are listed below.
+The AWS 2 DynamoDB component supports 17 options, which are listed below.
 
 
 
 [width="100%",cols="2,5,^1,2",options="header"]
 |===
 | Name | Description | Default | Type
-| *amazonDDBClient* (producer) | To use the AmazonDynamoDB as the client |  | DynamoDbClient
-| *autoDiscoverClient* (common) | Setting the autoDiscoverClient mechanism, if true, the component will look for a client instance in the registry automatically otherwise it will skip that checking. | true | boolean
+| *amazonDDBClient* (producer) | *Autowired* To use the AmazonDynamoDB as the client |  | DynamoDbClient
 | *configuration* (producer) | The component configuration |  | Ddb2Configuration
 | *consistentRead* (producer) | Determines whether or not strong consistency should be enforced when data is read. | false | boolean
 | *keyAttributeName* (producer) | Attribute name when creating table |  | String
@@ -92,14 +91,13 @@ with the following path and query parameters:
 |===
 
 
-=== Query Parameters (17 parameters):
+=== Query Parameters (16 parameters):
 
 
 [width="100%",cols="2,5,^1,2",options="header"]
 |===
 | Name | Description | Default | Type
-| *amazonDDBClient* (producer) | To use the AmazonDynamoDB as the client |  | DynamoDbClient
-| *autoDiscoverClient* (common) | Setting the autoDiscoverClient mechanism, if true, the component will look for a client instance in the registry automatically otherwise it will skip that checking. | true | boolean
+| *amazonDDBClient* (producer) | *Autowired* To use the AmazonDynamoDB as the client |  | DynamoDbClient
 | *consistentRead* (producer) | Determines whether or not strong consistency should be enforced when data is read. | false | boolean
 | *keyAttributeName* (producer) | Attribute name when creating table |  | String
 | *keyAttributeType* (producer) | Attribute type when creating table |  | String
diff --git a/components/camel-aws2-ddb/src/generated/java/org/apache/camel/component/aws2/ddb/Ddb2ComponentConfigurer.java b/components/camel-aws2-ddb/src/generated/java/org/apache/camel/component/aws2/ddb/Ddb2ComponentConfigurer.java
index cbb4b04..25021b8 100644
--- a/components/camel-aws2-ddb/src/generated/java/org/apache/camel/component/aws2/ddb/Ddb2ComponentConfigurer.java
+++ b/components/camel-aws2-ddb/src/generated/java/org/apache/camel/component/aws2/ddb/Ddb2ComponentConfigurer.java
@@ -32,8 +32,6 @@ public class Ddb2ComponentConfigurer extends PropertyConfigurerSupport implement
         case "accessKey": getOrCreateConfiguration(target).setAccessKey(property(camelContext, java.lang.String.class, value)); return true;
         case "amazonddbclient":
         case "amazonDDBClient": getOrCreateConfiguration(target).setAmazonDDBClient(property(camelContext, software.amazon.awssdk.services.dynamodb.DynamoDbClient.class, value)); return true;
-        case "autodiscoverclient":
-        case "autoDiscoverClient": getOrCreateConfiguration(target).setAutoDiscoverClient(property(camelContext, boolean.class, value)); return true;
         case "autowiredenabled":
         case "autowiredEnabled": target.setAutowiredEnabled(property(camelContext, boolean.class, value)); return true;
         case "configuration": target.setConfiguration(property(camelContext, org.apache.camel.component.aws2.ddb.Ddb2Configuration.class, value)); return true;
@@ -66,14 +64,17 @@ public class Ddb2ComponentConfigurer extends PropertyConfigurerSupport implement
     }
 
     @Override
+    public String[] getAutowiredNames() {
+        return new String[]{"amazonDDBClient"};
+    }
+
+    @Override
     public Class<?> getOptionType(String name, boolean ignoreCase) {
         switch (ignoreCase ? name.toLowerCase() : name) {
         case "accesskey":
         case "accessKey": return java.lang.String.class;
         case "amazonddbclient":
         case "amazonDDBClient": return software.amazon.awssdk.services.dynamodb.DynamoDbClient.class;
-        case "autodiscoverclient":
-        case "autoDiscoverClient": return boolean.class;
         case "autowiredenabled":
         case "autowiredEnabled": return boolean.class;
         case "configuration": return org.apache.camel.component.aws2.ddb.Ddb2Configuration.class;
@@ -113,8 +114,6 @@ public class Ddb2ComponentConfigurer extends PropertyConfigurerSupport implement
         case "accessKey": return getOrCreateConfiguration(target).getAccessKey();
         case "amazonddbclient":
         case "amazonDDBClient": return getOrCreateConfiguration(target).getAmazonDDBClient();
-        case "autodiscoverclient":
-        case "autoDiscoverClient": return getOrCreateConfiguration(target).isAutoDiscoverClient();
         case "autowiredenabled":
         case "autowiredEnabled": return target.isAutowiredEnabled();
         case "configuration": return target.getConfiguration();
diff --git a/components/camel-aws2-ddb/src/generated/java/org/apache/camel/component/aws2/ddb/Ddb2EndpointConfigurer.java b/components/camel-aws2-ddb/src/generated/java/org/apache/camel/component/aws2/ddb/Ddb2EndpointConfigurer.java
index 31e4464..e1311a1 100644
--- a/components/camel-aws2-ddb/src/generated/java/org/apache/camel/component/aws2/ddb/Ddb2EndpointConfigurer.java
+++ b/components/camel-aws2-ddb/src/generated/java/org/apache/camel/component/aws2/ddb/Ddb2EndpointConfigurer.java
@@ -25,8 +25,6 @@ public class Ddb2EndpointConfigurer extends PropertyConfigurerSupport implements
         case "accessKey": target.getConfiguration().setAccessKey(property(camelContext, java.lang.String.class, value)); return true;
         case "amazonddbclient":
         case "amazonDDBClient": target.getConfiguration().setAmazonDDBClient(property(camelContext, software.amazon.awssdk.services.dynamodb.DynamoDbClient.class, value)); return true;
-        case "autodiscoverclient":
-        case "autoDiscoverClient": target.getConfiguration().setAutoDiscoverClient(property(camelContext, boolean.class, value)); return true;
         case "consistentread":
         case "consistentRead": target.getConfiguration().setConsistentRead(property(camelContext, boolean.class, value)); return true;
         case "keyattributename":
@@ -57,14 +55,17 @@ public class Ddb2EndpointConfigurer extends PropertyConfigurerSupport implements
     }
 
     @Override
+    public String[] getAutowiredNames() {
+        return new String[]{"amazonDDBClient"};
+    }
+
+    @Override
     public Class<?> getOptionType(String name, boolean ignoreCase) {
         switch (ignoreCase ? name.toLowerCase() : name) {
         case "accesskey":
         case "accessKey": return java.lang.String.class;
         case "amazonddbclient":
         case "amazonDDBClient": return software.amazon.awssdk.services.dynamodb.DynamoDbClient.class;
-        case "autodiscoverclient":
-        case "autoDiscoverClient": return boolean.class;
         case "consistentread":
         case "consistentRead": return boolean.class;
         case "keyattributename":
@@ -102,8 +103,6 @@ public class Ddb2EndpointConfigurer extends PropertyConfigurerSupport implements
         case "accessKey": return target.getConfiguration().getAccessKey();
         case "amazonddbclient":
         case "amazonDDBClient": return target.getConfiguration().getAmazonDDBClient();
-        case "autodiscoverclient":
-        case "autoDiscoverClient": return target.getConfiguration().isAutoDiscoverClient();
         case "consistentread":
         case "consistentRead": return target.getConfiguration().isConsistentRead();
         case "keyattributename":
diff --git a/components/camel-aws2-ddb/src/generated/java/org/apache/camel/component/aws2/ddb/Ddb2EndpointUriFactory.java b/components/camel-aws2-ddb/src/generated/java/org/apache/camel/component/aws2/ddb/Ddb2EndpointUriFactory.java
index 2d6f816..7147a06 100644
--- a/components/camel-aws2-ddb/src/generated/java/org/apache/camel/component/aws2/ddb/Ddb2EndpointUriFactory.java
+++ b/components/camel-aws2-ddb/src/generated/java/org/apache/camel/component/aws2/ddb/Ddb2EndpointUriFactory.java
@@ -20,9 +20,8 @@ public class Ddb2EndpointUriFactory extends org.apache.camel.support.component.E
     private static final Set<String> PROPERTY_NAMES;
     private static final Set<String> SECRET_PROPERTY_NAMES;
     static {
-        Set<String> props = new HashSet<>(18);
+        Set<String> props = new HashSet<>(17);
         props.add("amazonDDBClient");
-        props.add("autoDiscoverClient");
         props.add("proxyProtocol");
         props.add("readCapacity");
         props.add("secretKey");
diff --git a/components/camel-aws2-ddb/src/generated/resources/org/apache/camel/component/aws2/ddb/aws2-ddb.json b/components/camel-aws2-ddb/src/generated/resources/org/apache/camel/component/aws2/ddb/aws2-ddb.json
index a7b6fe4..03af132 100644
--- a/components/camel-aws2-ddb/src/generated/resources/org/apache/camel/component/aws2/ddb/aws2-ddb.json
+++ b/components/camel-aws2-ddb/src/generated/resources/org/apache/camel/component/aws2/ddb/aws2-ddb.json
@@ -22,8 +22,7 @@
     "lenientProperties": false
   },
   "componentProperties": {
-    "amazonDDBClient": { "kind": "property", "displayName": "Amazon DDBClient", "group": "producer", "label": "", "required": false, "type": "object", "javaType": "software.amazon.awssdk.services.dynamodb.DynamoDbClient", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.ddb.Ddb2Configuration", "configurationField": "configuration", "description": "To use the AmazonDynamoDB as the client" },
-    "autoDiscoverClient": { "kind": "property", "displayName": "Auto Discover Client", "group": "common", "label": "common", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "configurationClass": "org.apache.camel.component.aws2.ddb.Ddb2Configuration", "configurationField": "configuration", "description": "Setting the autoDiscoverClient mechanism, if true, the component will look for a client inst [...]
+    "amazonDDBClient": { "kind": "property", "displayName": "Amazon DDBClient", "group": "producer", "label": "", "required": false, "type": "object", "javaType": "software.amazon.awssdk.services.dynamodb.DynamoDbClient", "deprecated": false, "deprecationNote": "", "autowired": true, "secret": false, "configurationClass": "org.apache.camel.component.aws2.ddb.Ddb2Configuration", "configurationField": "configuration", "description": "To use the AmazonDynamoDB as the client" },
     "configuration": { "kind": "property", "displayName": "Configuration", "group": "producer", "label": "", "required": false, "type": "object", "javaType": "org.apache.camel.component.aws2.ddb.Ddb2Configuration", "deprecated": false, "autowired": false, "secret": false, "description": "The component configuration" },
     "consistentRead": { "kind": "property", "displayName": "Consistent Read", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.aws2.ddb.Ddb2Configuration", "configurationField": "configuration", "description": "Determines whether or not strong consistency should be enforced when data is read." },
     "keyAttributeName": { "kind": "property", "displayName": "Key Attribute Name", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.ddb.Ddb2Configuration", "configurationField": "configuration", "description": "Attribute name when creating table" },
@@ -43,8 +42,7 @@
   },
   "properties": {
     "tableName": { "kind": "path", "displayName": "Table Name", "group": "producer", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.ddb.Ddb2Configuration", "configurationField": "configuration", "description": "The name of the table currently worked with." },
-    "amazonDDBClient": { "kind": "parameter", "displayName": "Amazon DDBClient", "group": "producer", "label": "", "required": false, "type": "object", "javaType": "software.amazon.awssdk.services.dynamodb.DynamoDbClient", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.ddb.Ddb2Configuration", "configurationField": "configuration", "description": "To use the AmazonDynamoDB as the client" },
-    "autoDiscoverClient": { "kind": "parameter", "displayName": "Auto Discover Client", "group": "common", "label": "common", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "configurationClass": "org.apache.camel.component.aws2.ddb.Ddb2Configuration", "configurationField": "configuration", "description": "Setting the autoDiscoverClient mechanism, if true, the component will look for a client ins [...]
+    "amazonDDBClient": { "kind": "parameter", "displayName": "Amazon DDBClient", "group": "producer", "label": "", "required": false, "type": "object", "javaType": "software.amazon.awssdk.services.dynamodb.DynamoDbClient", "deprecated": false, "deprecationNote": "", "autowired": true, "secret": false, "configurationClass": "org.apache.camel.component.aws2.ddb.Ddb2Configuration", "configurationField": "configuration", "description": "To use the AmazonDynamoDB as the client" },
     "consistentRead": { "kind": "parameter", "displayName": "Consistent Read", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.aws2.ddb.Ddb2Configuration", "configurationField": "configuration", "description": "Determines whether or not strong consistency should be enforced when data is read." },
     "keyAttributeName": { "kind": "parameter", "displayName": "Key Attribute Name", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.ddb.Ddb2Configuration", "configurationField": "configuration", "description": "Attribute name when creating table" },
     "keyAttributeType": { "kind": "parameter", "displayName": "Key Attribute Type", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.ddb.Ddb2Configuration", "configurationField": "configuration", "description": "Attribute type when creating table" },
diff --git a/components/camel-aws2-ddb/src/main/docs/aws2-ddb-component.adoc b/components/camel-aws2-ddb/src/main/docs/aws2-ddb-component.adoc
index efb68ec..d88aec7 100644
--- a/components/camel-aws2-ddb/src/main/docs/aws2-ddb-component.adoc
+++ b/components/camel-aws2-ddb/src/main/docs/aws2-ddb-component.adoc
@@ -42,15 +42,14 @@ You can append query options to the URI in the following format,
 
 
 // component options: START
-The AWS 2 DynamoDB component supports 18 options, which are listed below.
+The AWS 2 DynamoDB component supports 17 options, which are listed below.
 
 
 
 [width="100%",cols="2,5,^1,2",options="header"]
 |===
 | Name | Description | Default | Type
-| *amazonDDBClient* (producer) | To use the AmazonDynamoDB as the client |  | DynamoDbClient
-| *autoDiscoverClient* (common) | Setting the autoDiscoverClient mechanism, if true, the component will look for a client instance in the registry automatically otherwise it will skip that checking. | true | boolean
+| *amazonDDBClient* (producer) | *Autowired* To use the AmazonDynamoDB as the client |  | DynamoDbClient
 | *configuration* (producer) | The component configuration |  | Ddb2Configuration
 | *consistentRead* (producer) | Determines whether or not strong consistency should be enforced when data is read. | false | boolean
 | *keyAttributeName* (producer) | Attribute name when creating table |  | String
@@ -92,14 +91,13 @@ with the following path and query parameters:
 |===
 
 
-=== Query Parameters (17 parameters):
+=== Query Parameters (16 parameters):
 
 
 [width="100%",cols="2,5,^1,2",options="header"]
 |===
 | Name | Description | Default | Type
-| *amazonDDBClient* (producer) | To use the AmazonDynamoDB as the client |  | DynamoDbClient
-| *autoDiscoverClient* (common) | Setting the autoDiscoverClient mechanism, if true, the component will look for a client instance in the registry automatically otherwise it will skip that checking. | true | boolean
+| *amazonDDBClient* (producer) | *Autowired* To use the AmazonDynamoDB as the client |  | DynamoDbClient
 | *consistentRead* (producer) | Determines whether or not strong consistency should be enforced when data is read. | false | boolean
 | *keyAttributeName* (producer) | Attribute name when creating table |  | String
 | *keyAttributeType* (producer) | Attribute type when creating table |  | String
diff --git a/components/camel-aws2-ddb/src/main/java/org/apache/camel/component/aws2/ddb/Ddb2Component.java b/components/camel-aws2-ddb/src/main/java/org/apache/camel/component/aws2/ddb/Ddb2Component.java
index 944f9af..d8418cf 100644
--- a/components/camel-aws2-ddb/src/main/java/org/apache/camel/component/aws2/ddb/Ddb2Component.java
+++ b/components/camel-aws2-ddb/src/main/java/org/apache/camel/component/aws2/ddb/Ddb2Component.java
@@ -17,17 +17,14 @@
 package org.apache.camel.component.aws2.ddb;
 
 import java.util.Map;
-import java.util.Set;
 
 import org.apache.camel.CamelContext;
 import org.apache.camel.Endpoint;
 import org.apache.camel.spi.Metadata;
 import org.apache.camel.spi.annotations.Component;
 import org.apache.camel.support.DefaultComponent;
-import org.apache.camel.util.ObjectHelper;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
-import software.amazon.awssdk.services.dynamodb.DynamoDbClient;
 
 @Component("aws2-ddb")
 public class Ddb2Component extends DefaultComponent {
diff --git a/components/camel-aws2-ddb/src/test/java/org/apache/camel/component/aws2/ddb/DdbComponentRegistryClientTest.java b/components/camel-aws2-ddb/src/test/java/org/apache/camel/component/aws2/ddb/DdbComponentRegistryClientTest.java
index 247b3ad..72e43db 100644
--- a/components/camel-aws2-ddb/src/test/java/org/apache/camel/component/aws2/ddb/DdbComponentRegistryClientTest.java
+++ b/components/camel-aws2-ddb/src/test/java/org/apache/camel/component/aws2/ddb/DdbComponentRegistryClientTest.java
@@ -45,18 +45,6 @@ public class DdbComponentRegistryClientTest extends CamelTestSupport {
     }
 
     @Test
-    public void createEndpointWithAutoDiscoverFalse() throws Exception {
-        AmazonDDBClientMock ddbClient = new AmazonDDBClientMock();
-        context.getRegistry().bind("ddbClient", ddbClient);
-        Ddb2Component component = context.getComponent("aws2-ddb", Ddb2Component.class);
-        Ddb2Endpoint endpoint = (Ddb2Endpoint) component
-                .createEndpoint("aws2-ddb://myTable?accessKey=xxx&secretKey=yyy&autoDiscoverClient=false");
-
-        assertEquals("myTable", endpoint.getConfiguration().getTableName());
-        assertNotSame(ddbClient, endpoint.getConfiguration().getAmazonDDBClient());
-    }
-
-    @Test
     public void createEndpointWithAutoDiscoverTrue() throws Exception {
         AmazonDDBClientMock ddbClient = new AmazonDDBClientMock();
         context.getRegistry().bind("ddbClient", ddbClient);
diff --git a/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/Aws2DdbComponentBuilderFactory.java b/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/Aws2DdbComponentBuilderFactory.java
index 492d96a..33b5f58 100644
--- a/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/Aws2DdbComponentBuilderFactory.java
+++ b/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/Aws2DdbComponentBuilderFactory.java
@@ -62,21 +62,6 @@ public interface Aws2DdbComponentBuilderFactory {
             return this;
         }
         /**
-         * Setting the autoDiscoverClient mechanism, if true, the component will
-         * look for a client instance in the registry automatically otherwise it
-         * will skip that checking.
-         * 
-         * The option is a: <code>boolean</code> type.
-         * 
-         * Default: true
-         * Group: common
-         */
-        default Aws2DdbComponentBuilder autoDiscoverClient(
-                boolean autoDiscoverClient) {
-            doSetProperty("autoDiscoverClient", autoDiscoverClient);
-            return this;
-        }
-        /**
          * The component configuration.
          * 
          * The option is a:
@@ -316,7 +301,6 @@ public interface Aws2DdbComponentBuilderFactory {
                 Object value) {
             switch (name) {
             case "amazonDDBClient": getOrCreateConfiguration((Ddb2Component) component).setAmazonDDBClient((software.amazon.awssdk.services.dynamodb.DynamoDbClient) value); return true;
-            case "autoDiscoverClient": getOrCreateConfiguration((Ddb2Component) component).setAutoDiscoverClient((boolean) value); return true;
             case "configuration": ((Ddb2Component) component).setConfiguration((org.apache.camel.component.aws2.ddb.Ddb2Configuration) value); return true;
             case "consistentRead": getOrCreateConfiguration((Ddb2Component) component).setConsistentRead((boolean) value); return true;
             case "keyAttributeName": getOrCreateConfiguration((Ddb2Component) component).setKeyAttributeName((java.lang.String) value); return true;
diff --git a/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/Ddb2EndpointBuilderFactory.java b/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/Ddb2EndpointBuilderFactory.java
index 3c71036..1f26258 100644
--- a/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/Ddb2EndpointBuilderFactory.java
+++ b/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/Ddb2EndpointBuilderFactory.java
@@ -64,35 +64,6 @@ public interface Ddb2EndpointBuilderFactory {
             return this;
         }
         /**
-         * Setting the autoDiscoverClient mechanism, if true, the component will
-         * look for a client instance in the registry automatically otherwise it
-         * will skip that checking.
-         * 
-         * The option is a: <code>boolean</code> type.
-         * 
-         * Default: true
-         * Group: common
-         */
-        default Ddb2EndpointBuilder autoDiscoverClient(
-                boolean autoDiscoverClient) {
-            doSetProperty("autoDiscoverClient", autoDiscoverClient);
-            return this;
-        }
-        /**
-         * Setting the autoDiscoverClient mechanism, if true, the component will
-         * look for a client instance in the registry automatically otherwise it
-         * will skip that checking.
-         * 
-         * The option will be converted to a <code>boolean</code> type.
-         * 
-         * Default: true
-         * Group: common
-         */
-        default Ddb2EndpointBuilder autoDiscoverClient(String autoDiscoverClient) {
-            doSetProperty("autoDiscoverClient", autoDiscoverClient);
-            return this;
-        }
-        /**
          * Determines whether or not strong consistency should be enforced when
          * data is read.
          * 
diff --git a/docs/components/modules/ROOT/pages/aws2-ddb-component.adoc b/docs/components/modules/ROOT/pages/aws2-ddb-component.adoc
index 007e5ed..034d9b1 100644
--- a/docs/components/modules/ROOT/pages/aws2-ddb-component.adoc
+++ b/docs/components/modules/ROOT/pages/aws2-ddb-component.adoc
@@ -44,15 +44,14 @@ You can append query options to the URI in the following format,
 
 
 // component options: START
-The AWS 2 DynamoDB component supports 18 options, which are listed below.
+The AWS 2 DynamoDB component supports 17 options, which are listed below.
 
 
 
 [width="100%",cols="2,5,^1,2",options="header"]
 |===
 | Name | Description | Default | Type
-| *amazonDDBClient* (producer) | To use the AmazonDynamoDB as the client |  | DynamoDbClient
-| *autoDiscoverClient* (common) | Setting the autoDiscoverClient mechanism, if true, the component will look for a client instance in the registry automatically otherwise it will skip that checking. | true | boolean
+| *amazonDDBClient* (producer) | *Autowired* To use the AmazonDynamoDB as the client |  | DynamoDbClient
 | *configuration* (producer) | The component configuration |  | Ddb2Configuration
 | *consistentRead* (producer) | Determines whether or not strong consistency should be enforced when data is read. | false | boolean
 | *keyAttributeName* (producer) | Attribute name when creating table |  | String
@@ -94,14 +93,13 @@ with the following path and query parameters:
 |===
 
 
-=== Query Parameters (17 parameters):
+=== Query Parameters (16 parameters):
 
 
 [width="100%",cols="2,5,^1,2",options="header"]
 |===
 | Name | Description | Default | Type
-| *amazonDDBClient* (producer) | To use the AmazonDynamoDB as the client |  | DynamoDbClient
-| *autoDiscoverClient* (common) | Setting the autoDiscoverClient mechanism, if true, the component will look for a client instance in the registry automatically otherwise it will skip that checking. | true | boolean
+| *amazonDDBClient* (producer) | *Autowired* To use the AmazonDynamoDB as the client |  | DynamoDbClient
 | *consistentRead* (producer) | Determines whether or not strong consistency should be enforced when data is read. | false | boolean
 | *keyAttributeName* (producer) | Attribute name when creating table |  | String
 | *keyAttributeType* (producer) | Attribute type when creating table |  | String


[camel] 03/10: CAMEL-15836 - Camel-AWS2-DDB: enable autowire on the DynamoDb client, renamed autodiscover test

Posted by ac...@apache.org.
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

commit 9d8a890d9d0018628d0a5b59ac1db03d7a75a430
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Fri Nov 13 11:51:35 2020 +0100

    CAMEL-15836 - Camel-AWS2-DDB: enable autowire on the DynamoDb client, renamed autodiscover test
---
 .../apache/camel/component/aws2/ddb/DdbComponentRegistryClientTest.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/components/camel-aws2-ddb/src/test/java/org/apache/camel/component/aws2/ddb/DdbComponentRegistryClientTest.java b/components/camel-aws2-ddb/src/test/java/org/apache/camel/component/aws2/ddb/DdbComponentRegistryClientTest.java
index 72e43db..6822fc5 100644
--- a/components/camel-aws2-ddb/src/test/java/org/apache/camel/component/aws2/ddb/DdbComponentRegistryClientTest.java
+++ b/components/camel-aws2-ddb/src/test/java/org/apache/camel/component/aws2/ddb/DdbComponentRegistryClientTest.java
@@ -45,7 +45,7 @@ public class DdbComponentRegistryClientTest extends CamelTestSupport {
     }
 
     @Test
-    public void createEndpointWithAutoDiscoverTrue() throws Exception {
+    public void createEndpointWithAutowire() throws Exception {
         AmazonDDBClientMock ddbClient = new AmazonDDBClientMock();
         context.getRegistry().bind("ddbClient", ddbClient);
         Ddb2Component component = context.getComponent("aws2-ddb", Ddb2Component.class);


[camel] 07/10: CAMEL-15836 - Camel-AWS2-DDB: enable autowire on the DynamoDbStreams client

Posted by ac...@apache.org.
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

commit f3553a75d15a941eb178f9b38e7b61c876529b5c
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Fri Nov 13 12:51:31 2020 +0100

    CAMEL-15836 - Camel-AWS2-DDB: enable autowire on the DynamoDbStreams client
---
 .../component/aws2/ddbstream/Ddb2StreamComponent.java  | 18 ------------------
 .../aws2/ddbstream/Ddb2StreamConfiguration.java        | 13 +------------
 2 files changed, 1 insertion(+), 30 deletions(-)

diff --git a/components/camel-aws2-ddb/src/main/java/org/apache/camel/component/aws2/ddbstream/Ddb2StreamComponent.java b/components/camel-aws2-ddb/src/main/java/org/apache/camel/component/aws2/ddbstream/Ddb2StreamComponent.java
index bb1b724..c09427a 100644
--- a/components/camel-aws2-ddb/src/main/java/org/apache/camel/component/aws2/ddbstream/Ddb2StreamComponent.java
+++ b/components/camel-aws2-ddb/src/main/java/org/apache/camel/component/aws2/ddbstream/Ddb2StreamComponent.java
@@ -58,9 +58,6 @@ public class Ddb2StreamComponent extends DefaultComponent {
         configuration.setTableName(remaining);
         Ddb2StreamEndpoint endpoint = new Ddb2StreamEndpoint(uri, configuration, this);
         setProperties(endpoint, parameters);
-        if (endpoint.getConfiguration().isAutoDiscoverClient()) {
-            checkAndSetRegistryClient(configuration, endpoint);
-        }
         if (configuration.getAmazonDynamoDbStreamsClient() == null
                 && (configuration.getAccessKey() == null || configuration.getSecretKey() == null)) {
             throw new IllegalArgumentException("amazonDDBStreamsClient or accessKey and secretKey must be specified");
@@ -78,19 +75,4 @@ public class Ddb2StreamComponent extends DefaultComponent {
     public void setConfiguration(Ddb2StreamConfiguration configuration) {
         this.configuration = configuration;
     }
-
-    private void checkAndSetRegistryClient(Ddb2StreamConfiguration configuration, Ddb2StreamEndpoint endpoint) {
-        if (ObjectHelper.isEmpty(endpoint.getConfiguration().getAmazonDynamoDbStreamsClient())) {
-            LOG.debug("Looking for an DynamoDbStreamsClient instance in the registry");
-            Set<DynamoDbStreamsClient> clients = getCamelContext().getRegistry().findByType(DynamoDbStreamsClient.class);
-            if (clients.size() == 1) {
-                LOG.debug("Found exactly one DynamoDbStreamsClient instance in the registry");
-                configuration.setAmazonDynamoDbStreamsClient(clients.stream().findFirst().get());
-            } else {
-                LOG.debug("No DynamoDbStreamsClient instance in the registry");
-            }
-        } else {
-            LOG.debug("DynamoDbStreamsClient instance is already set at endpoint level: skipping the check in the registry");
-        }
-    }
 }
diff --git a/components/camel-aws2-ddb/src/main/java/org/apache/camel/component/aws2/ddbstream/Ddb2StreamConfiguration.java b/components/camel-aws2-ddb/src/main/java/org/apache/camel/component/aws2/ddbstream/Ddb2StreamConfiguration.java
index 40bef39..c79a32b 100644
--- a/components/camel-aws2-ddb/src/main/java/org/apache/camel/component/aws2/ddbstream/Ddb2StreamConfiguration.java
+++ b/components/camel-aws2-ddb/src/main/java/org/apache/camel/component/aws2/ddbstream/Ddb2StreamConfiguration.java
@@ -40,6 +40,7 @@ public class Ddb2StreamConfiguration implements Cloneable {
     private String region;
 
     @UriParam(label = "consumer", description = "Amazon DynamoDB client to use for all requests for this endpoint")
+    @Metadata(autowired = true)
     private DynamoDbStreamsClient amazonDynamoDbStreamsClient;
 
     @UriParam(label = "consumer", description = "Maximum number of records that will be fetched in each poll")
@@ -67,10 +68,6 @@ public class Ddb2StreamConfiguration implements Cloneable {
     private Integer proxyPort;
     @UriParam(defaultValue = "false", description = "If we want to trust all certificates in case of overriding the endpoint")
     private boolean trustAllCertificates;
-    @UriParam(label = "common", defaultValue = "true",
-              description = "Setting the autoDiscoverClient mechanism, if true, the component will "
-                            + " look for a client instance in the registry automatically otherwise it will skip that checking")
-    private boolean autoDiscoverClient = true;
 
     public DynamoDbStreamsClient getAmazonDynamoDbStreamsClient() {
         return amazonDynamoDbStreamsClient;
@@ -168,14 +165,6 @@ public class Ddb2StreamConfiguration implements Cloneable {
         this.trustAllCertificates = trustAllCertificates;
     }
 
-    public boolean isAutoDiscoverClient() {
-        return autoDiscoverClient;
-    }
-
-    public void setAutoDiscoverClient(boolean autoDiscoverClient) {
-        this.autoDiscoverClient = autoDiscoverClient;
-    }
-
     // *************************************************
     //
     // *************************************************


[camel] 04/10: CAMEL-15836 - Camel-AWS2-DDB: enable autowire on the DynamoDb client, fixed tests

Posted by ac...@apache.org.
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

commit 04e8741fed774054b90fedddf9bc57082cb1f94e
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Fri Nov 13 11:53:36 2020 +0100

    CAMEL-15836 - Camel-AWS2-DDB: enable autowire on the DynamoDb client, fixed tests
---
 .../apache/camel/component/aws2/ddb/DdbComponentRegistryClientTest.java  | 1 -
 1 file changed, 1 deletion(-)

diff --git a/components/camel-aws2-ddb/src/test/java/org/apache/camel/component/aws2/ddb/DdbComponentRegistryClientTest.java b/components/camel-aws2-ddb/src/test/java/org/apache/camel/component/aws2/ddb/DdbComponentRegistryClientTest.java
index 6822fc5..607fd12 100644
--- a/components/camel-aws2-ddb/src/test/java/org/apache/camel/component/aws2/ddb/DdbComponentRegistryClientTest.java
+++ b/components/camel-aws2-ddb/src/test/java/org/apache/camel/component/aws2/ddb/DdbComponentRegistryClientTest.java
@@ -20,7 +20,6 @@ import org.apache.camel.test.junit5.CamelTestSupport;
 import org.junit.jupiter.api.Test;
 
 import static org.junit.jupiter.api.Assertions.assertEquals;
-import static org.junit.jupiter.api.Assertions.assertNotSame;
 import static org.junit.jupiter.api.Assertions.assertSame;
 import static org.junit.jupiter.api.Assertions.assertThrows;
 


[camel] 10/10: CAMEL-15836 - Camel-AWS2-DDB: enable autowire on the DynamoDbStreams client, added a note in migration guide

Posted by ac...@apache.org.
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

commit ec6b1ab4adb442b9341ba828de50101d5d8b0c4c
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Fri Nov 13 12:58:59 2020 +0100

    CAMEL-15836 - Camel-AWS2-DDB: enable autowire on the DynamoDbStreams client, added a note in migration guide
---
 docs/user-manual/modules/ROOT/pages/camel-3x-upgrade-guide-3_7.adoc | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/docs/user-manual/modules/ROOT/pages/camel-3x-upgrade-guide-3_7.adoc b/docs/user-manual/modules/ROOT/pages/camel-3x-upgrade-guide-3_7.adoc
index 32d057e..119c291 100644
--- a/docs/user-manual/modules/ROOT/pages/camel-3x-upgrade-guide-3_7.adoc
+++ b/docs/user-manual/modules/ROOT/pages/camel-3x-upgrade-guide-3_7.adoc
@@ -173,3 +173,6 @@ In this context, it wasn't having any sense to maintain the autodiscoverClient o
 The camel-aws2-ddb has now support for autowiring the amazonDDBClient option with DynamoDbClient instance coming from the registry.
 In this context, it wasn't having any sense to maintain the autodiscoverClient option, which has been now removed.
 
+The camel-aws2-ddbstreams has now support for autowiring the amazonDynamoDbStreamsClient option with DynamoDbStreamsClient instance coming from the registry.
+In this context, it wasn't having any sense to maintain the autodiscoverClient option, which has been now removed.
+


[camel] 09/10: CAMEL-15836 - Camel-AWS2-DDB: enable autowire on the DynamoDbStreams client, regen catalog

Posted by ac...@apache.org.
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

commit e7e5ccb59ac9e5998c983c768d0e3acb7deec193
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Fri Nov 13 12:56:50 2020 +0100

    CAMEL-15836 - Camel-AWS2-DDB: enable autowire on the DynamoDbStreams client, regen catalog
---
 .../org/apache/camel/catalog/components/aws2-ddbstream.json         | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/aws2-ddbstream.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/aws2-ddbstream.json
index 32f05c8..6bb93ea 100644
--- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/aws2-ddbstream.json
+++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/aws2-ddbstream.json
@@ -22,8 +22,7 @@
     "lenientProperties": false
   },
   "componentProperties": {
-    "autoDiscoverClient": { "kind": "property", "displayName": "Auto Discover Client", "group": "common", "label": "common", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "configurationClass": "org.apache.camel.component.aws2.ddbstream.Ddb2StreamConfiguration", "configurationField": "configuration", "description": "Setting the autoDiscoverClient mechanism, if true, the component will look for a [...]
-    "amazonDynamoDbStreamsClient": { "kind": "property", "displayName": "Amazon Dynamo Db Streams Client", "group": "consumer", "label": "consumer", "required": false, "type": "object", "javaType": "software.amazon.awssdk.services.dynamodb.streams.DynamoDbStreamsClient", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.ddbstream.Ddb2StreamConfiguration", "configurationField": "configuration", "description": "Amazon DynamoDB  [...]
+    "amazonDynamoDbStreamsClient": { "kind": "property", "displayName": "Amazon Dynamo Db Streams Client", "group": "consumer", "label": "consumer", "required": false, "type": "object", "javaType": "software.amazon.awssdk.services.dynamodb.streams.DynamoDbStreamsClient", "deprecated": false, "deprecationNote": "", "autowired": true, "secret": false, "configurationClass": "org.apache.camel.component.aws2.ddbstream.Ddb2StreamConfiguration", "configurationField": "configuration", "descripti [...]
     "bridgeErrorHandler": { "kind": "property", "displayName": "Bridge Error Handler", "group": "consumer", "label": "consumer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "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 me [...]
     "configuration": { "kind": "property", "displayName": "Configuration", "group": "consumer", "label": "", "required": false, "type": "object", "javaType": "org.apache.camel.component.aws2.ddbstream.Ddb2StreamConfiguration", "deprecated": false, "autowired": false, "secret": false, "description": "The component configuration" },
     "iteratorType": { "kind": "property", "displayName": "Iterator Type", "group": "consumer", "label": "consumer", "required": false, "type": "object", "javaType": "software.amazon.awssdk.services.dynamodb.model.ShardIteratorType", "enum": [ "TRIM_HORIZON", "LATEST", "AT_SEQUENCE_NUMBER", "AFTER_SEQUENCE_NUMBER", "null" ], "deprecated": false, "autowired": false, "secret": false, "defaultValue": "LATEST", "configurationClass": "org.apache.camel.component.aws2.ddbstream.Ddb2StreamConfigu [...]
@@ -40,8 +39,7 @@
   },
   "properties": {
     "tableName": { "kind": "path", "displayName": "Table Name", "group": "consumer", "label": "consumer", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.ddbstream.Ddb2StreamConfiguration", "configurationField": "configuration", "description": "Name of the dynamodb table" },
-    "autoDiscoverClient": { "kind": "parameter", "displayName": "Auto Discover Client", "group": "common", "label": "common", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "configurationClass": "org.apache.camel.component.aws2.ddbstream.Ddb2StreamConfiguration", "configurationField": "configuration", "description": "Setting the autoDiscoverClient mechanism, if true, the component will look for  [...]
-    "amazonDynamoDbStreamsClient": { "kind": "parameter", "displayName": "Amazon Dynamo Db Streams Client", "group": "consumer", "label": "consumer", "required": false, "type": "object", "javaType": "software.amazon.awssdk.services.dynamodb.streams.DynamoDbStreamsClient", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.ddbstream.Ddb2StreamConfiguration", "configurationField": "configuration", "description": "Amazon DynamoDB [...]
+    "amazonDynamoDbStreamsClient": { "kind": "parameter", "displayName": "Amazon Dynamo Db Streams Client", "group": "consumer", "label": "consumer", "required": false, "type": "object", "javaType": "software.amazon.awssdk.services.dynamodb.streams.DynamoDbStreamsClient", "deprecated": false, "deprecationNote": "", "autowired": true, "secret": false, "configurationClass": "org.apache.camel.component.aws2.ddbstream.Ddb2StreamConfiguration", "configurationField": "configuration", "descript [...]
     "bridgeErrorHandler": { "kind": "parameter", "displayName": "Bridge Error Handler", "group": "consumer", "label": "consumer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "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 m [...]
     "iteratorType": { "kind": "parameter", "displayName": "Iterator Type", "group": "consumer", "label": "consumer", "required": false, "type": "object", "javaType": "software.amazon.awssdk.services.dynamodb.model.ShardIteratorType", "enum": [ "TRIM_HORIZON", "LATEST", "AT_SEQUENCE_NUMBER", "AFTER_SEQUENCE_NUMBER", "null" ], "deprecated": false, "autowired": false, "secret": false, "defaultValue": "LATEST", "configurationClass": "org.apache.camel.component.aws2.ddbstream.Ddb2StreamConfig [...]
     "maxResultsPerRequest": { "kind": "parameter", "displayName": "Max Results Per Request", "group": "consumer", "label": "consumer", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.ddbstream.Ddb2StreamConfiguration", "configurationField": "configuration", "description": "Maximum number of records that will be fetched in each poll" },


[camel] 01/10: CAMEL-15836 - Camel-AWS2-DDB: enable autowire on the DynamoDb client

Posted by ac...@apache.org.
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

commit 858ba2f445911cb2e7c60b90f9f87bc92d5ca43b
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Fri Nov 13 11:49:43 2020 +0100

    CAMEL-15836 - Camel-AWS2-DDB: enable autowire on the DynamoDb client
---
 .../apache/camel/component/aws2/ddb/Ddb2Component.java | 18 ------------------
 .../camel/component/aws2/ddb/Ddb2Configuration.java    | 15 +--------------
 2 files changed, 1 insertion(+), 32 deletions(-)

diff --git a/components/camel-aws2-ddb/src/main/java/org/apache/camel/component/aws2/ddb/Ddb2Component.java b/components/camel-aws2-ddb/src/main/java/org/apache/camel/component/aws2/ddb/Ddb2Component.java
index e14096f..944f9af 100644
--- a/components/camel-aws2-ddb/src/main/java/org/apache/camel/component/aws2/ddb/Ddb2Component.java
+++ b/components/camel-aws2-ddb/src/main/java/org/apache/camel/component/aws2/ddb/Ddb2Component.java
@@ -57,9 +57,6 @@ public class Ddb2Component extends DefaultComponent {
         configuration.setTableName(remaining);
         Ddb2Endpoint endpoint = new Ddb2Endpoint(uri, this, configuration);
         setProperties(endpoint, parameters);
-        if (endpoint.getConfiguration().isAutoDiscoverClient()) {
-            checkAndSetRegistryClient(configuration, endpoint);
-        }
         if (configuration.getAmazonDDBClient() == null
                 && (configuration.getAccessKey() == null || configuration.getSecretKey() == null)) {
             throw new IllegalArgumentException("amazonDDBClient or accessKey and secretKey must be specified");
@@ -78,19 +75,4 @@ public class Ddb2Component extends DefaultComponent {
     public void setConfiguration(Ddb2Configuration configuration) {
         this.configuration = configuration;
     }
-
-    private void checkAndSetRegistryClient(Ddb2Configuration configuration, Ddb2Endpoint endpoint) {
-        if (ObjectHelper.isEmpty(endpoint.getConfiguration().getAmazonDDBClient())) {
-            LOG.debug("Looking for an DynamoDbClient instance in the registry");
-            Set<DynamoDbClient> clients = getCamelContext().getRegistry().findByType(DynamoDbClient.class);
-            if (clients.size() == 1) {
-                LOG.debug("Found exactly one DynamoDbClient instance in the registry");
-                configuration.setAmazonDDBClient(clients.stream().findFirst().get());
-            } else {
-                LOG.debug("No DynamoDbClient instance in the registry");
-            }
-        } else {
-            LOG.debug("DynamoDbClient instance is already set at endpoint level: skipping the check in the registry");
-        }
-    }
 }
diff --git a/components/camel-aws2-ddb/src/main/java/org/apache/camel/component/aws2/ddb/Ddb2Configuration.java b/components/camel-aws2-ddb/src/main/java/org/apache/camel/component/aws2/ddb/Ddb2Configuration.java
index 1b68538..3677b26 100644
--- a/components/camel-aws2-ddb/src/main/java/org/apache/camel/component/aws2/ddb/Ddb2Configuration.java
+++ b/components/camel-aws2-ddb/src/main/java/org/apache/camel/component/aws2/ddb/Ddb2Configuration.java
@@ -35,6 +35,7 @@ public class Ddb2Configuration implements Cloneable {
     @UriParam(label = "security", secret = true)
     private String secretKey;
     @UriParam
+    @Metadata(autowired = true)
     private DynamoDbClient amazonDDBClient;
     @UriParam
     private boolean consistentRead;
@@ -58,8 +59,6 @@ public class Ddb2Configuration implements Cloneable {
     private String region;
     @UriParam(defaultValue = "false")
     private boolean trustAllCertificates;
-    @UriParam(label = "common", defaultValue = "true")
-    private boolean autoDiscoverClient = true;
 
     public String getAccessKey() {
         return accessKey;
@@ -227,18 +226,6 @@ public class Ddb2Configuration implements Cloneable {
         this.trustAllCertificates = trustAllCertificates;
     }
 
-    public boolean isAutoDiscoverClient() {
-        return autoDiscoverClient;
-    }
-
-    /**
-     * Setting the autoDiscoverClient mechanism, if true, the component will look for a client instance in the registry
-     * automatically otherwise it will skip that checking.
-     */
-    public void setAutoDiscoverClient(boolean autoDiscoverClient) {
-        this.autoDiscoverClient = autoDiscoverClient;
-    }
-
     // *************************************************
     //
     // *************************************************


[camel] 06/10: CAMEL-15836 - Camel-AWS2-DDB: enable autowire on the DynamoDb client, added a note in migration guide

Posted by ac...@apache.org.
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

commit 49de3f52bd7982b95489c89c7febf9d4341c8d55
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Fri Nov 13 12:01:12 2020 +0100

    CAMEL-15836 - Camel-AWS2-DDB: enable autowire on the DynamoDb client, added a note in migration guide
---
 docs/user-manual/modules/ROOT/pages/camel-3x-upgrade-guide-3_7.adoc | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/docs/user-manual/modules/ROOT/pages/camel-3x-upgrade-guide-3_7.adoc b/docs/user-manual/modules/ROOT/pages/camel-3x-upgrade-guide-3_7.adoc
index abe8c0c..32d057e 100644
--- a/docs/user-manual/modules/ROOT/pages/camel-3x-upgrade-guide-3_7.adoc
+++ b/docs/user-manual/modules/ROOT/pages/camel-3x-upgrade-guide-3_7.adoc
@@ -168,3 +168,8 @@ In this context, it wasn't having any sense to maintain the autodiscoverClient o
 The camel-aws2-cw has now support for autowiring the amazonCwClient option with CloudWatchClient instance coming from the registry.
 In this context, it wasn't having any sense to maintain the autodiscoverClient option, which has been now removed.
 
+=== Camel-AWS2-DDB Autowire support
+
+The camel-aws2-ddb has now support for autowiring the amazonDDBClient option with DynamoDbClient instance coming from the registry.
+In this context, it wasn't having any sense to maintain the autodiscoverClient option, which has been now removed.
+


[camel] 05/10: CAMEL-15836 - Camel-AWS2-DDB: enable autowire on the DynamoDb client, catalog regen

Posted by ac...@apache.org.
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

commit 11c2f0a60c1816665de300bfdaa40c12b6f69a7b
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Fri Nov 13 12:00:22 2020 +0100

    CAMEL-15836 - Camel-AWS2-DDB: enable autowire on the DynamoDb client, catalog regen
---
 .../resources/org/apache/camel/catalog/components/aws2-ddb.json     | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/aws2-ddb.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/aws2-ddb.json
index a7b6fe4..03af132 100644
--- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/aws2-ddb.json
+++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/aws2-ddb.json
@@ -22,8 +22,7 @@
     "lenientProperties": false
   },
   "componentProperties": {
-    "amazonDDBClient": { "kind": "property", "displayName": "Amazon DDBClient", "group": "producer", "label": "", "required": false, "type": "object", "javaType": "software.amazon.awssdk.services.dynamodb.DynamoDbClient", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.ddb.Ddb2Configuration", "configurationField": "configuration", "description": "To use the AmazonDynamoDB as the client" },
-    "autoDiscoverClient": { "kind": "property", "displayName": "Auto Discover Client", "group": "common", "label": "common", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "configurationClass": "org.apache.camel.component.aws2.ddb.Ddb2Configuration", "configurationField": "configuration", "description": "Setting the autoDiscoverClient mechanism, if true, the component will look for a client inst [...]
+    "amazonDDBClient": { "kind": "property", "displayName": "Amazon DDBClient", "group": "producer", "label": "", "required": false, "type": "object", "javaType": "software.amazon.awssdk.services.dynamodb.DynamoDbClient", "deprecated": false, "deprecationNote": "", "autowired": true, "secret": false, "configurationClass": "org.apache.camel.component.aws2.ddb.Ddb2Configuration", "configurationField": "configuration", "description": "To use the AmazonDynamoDB as the client" },
     "configuration": { "kind": "property", "displayName": "Configuration", "group": "producer", "label": "", "required": false, "type": "object", "javaType": "org.apache.camel.component.aws2.ddb.Ddb2Configuration", "deprecated": false, "autowired": false, "secret": false, "description": "The component configuration" },
     "consistentRead": { "kind": "property", "displayName": "Consistent Read", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.aws2.ddb.Ddb2Configuration", "configurationField": "configuration", "description": "Determines whether or not strong consistency should be enforced when data is read." },
     "keyAttributeName": { "kind": "property", "displayName": "Key Attribute Name", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.ddb.Ddb2Configuration", "configurationField": "configuration", "description": "Attribute name when creating table" },
@@ -43,8 +42,7 @@
   },
   "properties": {
     "tableName": { "kind": "path", "displayName": "Table Name", "group": "producer", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.ddb.Ddb2Configuration", "configurationField": "configuration", "description": "The name of the table currently worked with." },
-    "amazonDDBClient": { "kind": "parameter", "displayName": "Amazon DDBClient", "group": "producer", "label": "", "required": false, "type": "object", "javaType": "software.amazon.awssdk.services.dynamodb.DynamoDbClient", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.ddb.Ddb2Configuration", "configurationField": "configuration", "description": "To use the AmazonDynamoDB as the client" },
-    "autoDiscoverClient": { "kind": "parameter", "displayName": "Auto Discover Client", "group": "common", "label": "common", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "configurationClass": "org.apache.camel.component.aws2.ddb.Ddb2Configuration", "configurationField": "configuration", "description": "Setting the autoDiscoverClient mechanism, if true, the component will look for a client ins [...]
+    "amazonDDBClient": { "kind": "parameter", "displayName": "Amazon DDBClient", "group": "producer", "label": "", "required": false, "type": "object", "javaType": "software.amazon.awssdk.services.dynamodb.DynamoDbClient", "deprecated": false, "deprecationNote": "", "autowired": true, "secret": false, "configurationClass": "org.apache.camel.component.aws2.ddb.Ddb2Configuration", "configurationField": "configuration", "description": "To use the AmazonDynamoDB as the client" },
     "consistentRead": { "kind": "parameter", "displayName": "Consistent Read", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.aws2.ddb.Ddb2Configuration", "configurationField": "configuration", "description": "Determines whether or not strong consistency should be enforced when data is read." },
     "keyAttributeName": { "kind": "parameter", "displayName": "Key Attribute Name", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.ddb.Ddb2Configuration", "configurationField": "configuration", "description": "Attribute name when creating table" },
     "keyAttributeType": { "kind": "parameter", "displayName": "Key Attribute Type", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.ddb.Ddb2Configuration", "configurationField": "configuration", "description": "Attribute type when creating table" },