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 10:07:03 UTC

[camel] branch master updated (f093095 -> ba3e33e)

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 f093095  CAMEL-15847: Remove camel-core dependency from camel-workday
     new 73be2d8  CAMEL-15836 - Camel-AWS2-Cloudwatch: enable autowire on the cloudwatch client
     new a753c52  CAMEL-15836 - Camel-AWS2-Cloudwatch: enable autowire on the cloudwatch client, fixe tests and regen
     new 12e09db  CAMEL-15836 - Camel-AWS2-Cloudwatch: enable autowire on the cloudwatch client, regen catalog
     new ba3e33e  CAMEL-15836 - Camel-AWS2-Cloudwatch: enable autowire on the cloudwatch client, added a note in migration guide

The 4 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-cw.json   |  6 ++---
 .../camel/catalog/docs/aws2-cw-component.adoc      | 10 ++++----
 .../component/aws2/cw/Cw2ComponentConfigurer.java  | 11 ++++-----
 .../component/aws2/cw/Cw2EndpointConfigurer.java   | 11 ++++-----
 .../component/aws2/cw/Cw2EndpointUriFactory.java   |  3 +--
 .../apache/camel/component/aws2/cw/aws2-cw.json    |  6 ++---
 .../src/main/docs/aws2-cw-component.adoc           | 10 ++++----
 .../camel/component/aws2/cw/Cw2Component.java      | 21 ----------------
 .../camel/component/aws2/cw/Cw2Configuration.java  | 15 +-----------
 .../aws2/cw/CwComponentRegistryClientTest.java     | 15 +-----------
 .../dsl/Aws2CwComponentBuilderFactory.java         | 16 -------------
 .../endpoint/dsl/Cw2EndpointBuilderFactory.java    | 28 ----------------------
 .../modules/ROOT/pages/aws2-cw-component.adoc      | 10 ++++----
 .../ROOT/pages/camel-3x-upgrade-guide-3_7.adoc     |  5 ++++
 14 files changed, 34 insertions(+), 133 deletions(-)


[camel] 04/04: CAMEL-15836 - Camel-AWS2-Cloudwatch: enable autowire on the cloudwatch 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 ba3e33e71388dd7cbfef9389051e69456c9752e4
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Fri Nov 13 11:06:08 2020 +0100

    CAMEL-15836 - Camel-AWS2-Cloudwatch: enable autowire on the cloudwatch 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 df9610d..abe8c0c 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
@@ -163,3 +163,8 @@ Other information have been stored in headers declared in GitConstants class
 The camel-aws2-s3 has now support for autowiring the amazonS3Client option with S3Client 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-Cloudwatch Autowire support
+
+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] 01/04: CAMEL-15836 - Camel-AWS2-Cloudwatch: enable autowire on the cloudwatch 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 73be2d8de8b6d32fbd3cfc3251e25df573347a59
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Fri Nov 13 09:14:53 2020 +0100

    CAMEL-15836 - Camel-AWS2-Cloudwatch: enable autowire on the cloudwatch client
---
 .../apache/camel/component/aws2/cw/Cw2Component.java   | 18 ------------------
 .../camel/component/aws2/cw/Cw2Configuration.java      | 15 +--------------
 2 files changed, 1 insertion(+), 32 deletions(-)

diff --git a/components/camel-aws2-cw/src/main/java/org/apache/camel/component/aws2/cw/Cw2Component.java b/components/camel-aws2-cw/src/main/java/org/apache/camel/component/aws2/cw/Cw2Component.java
index 0588755..ddaf518 100644
--- a/components/camel-aws2-cw/src/main/java/org/apache/camel/component/aws2/cw/Cw2Component.java
+++ b/components/camel-aws2-cw/src/main/java/org/apache/camel/component/aws2/cw/Cw2Component.java
@@ -63,9 +63,6 @@ public class Cw2Component extends DefaultComponent {
         // parameters
         setProperties(endpoint, parameters);
 
-        if (endpoint.getConfiguration().isAutoDiscoverClient()) {
-            checkAndSetRegistryClient(configuration, endpoint);
-        }
         if (configuration.getAmazonCwClient() == null
                 && (configuration.getAccessKey() == null || configuration.getSecretKey() == null)) {
             throw new IllegalArgumentException("AmazonCwClient or accessKey and secretKey must be specified");
@@ -84,19 +81,4 @@ public class Cw2Component extends DefaultComponent {
     public void setConfiguration(Cw2Configuration configuration) {
         this.configuration = configuration;
     }
-
-    private void checkAndSetRegistryClient(Cw2Configuration configuration, Cw2Endpoint endpoint) {
-        if (ObjectHelper.isEmpty(endpoint.getConfiguration().getAmazonCwClient())) {
-            LOG.debug("Looking for an CloudWatchClient instance in the registry");
-            Set<CloudWatchClient> clients = getCamelContext().getRegistry().findByType(CloudWatchClient.class);
-            if (clients.size() == 1) {
-                LOG.debug("Found exactly one CloudWatchClient instance in the registry");
-                configuration.setAmazonCwClient(clients.stream().findFirst().get());
-            } else {
-                LOG.debug("No CloudWatchClient instance in the registry");
-            }
-        } else {
-            LOG.debug("CloudWatchClient instance is already set at endpoint level: skipping the check in the registry");
-        }
-    }
 }
diff --git a/components/camel-aws2-cw/src/main/java/org/apache/camel/component/aws2/cw/Cw2Configuration.java b/components/camel-aws2-cw/src/main/java/org/apache/camel/component/aws2/cw/Cw2Configuration.java
index 61f818e..fd9dae2 100644
--- a/components/camel-aws2-cw/src/main/java/org/apache/camel/component/aws2/cw/Cw2Configuration.java
+++ b/components/camel-aws2-cw/src/main/java/org/apache/camel/component/aws2/cw/Cw2Configuration.java
@@ -33,6 +33,7 @@ public class Cw2Configuration implements Cloneable {
     @Metadata(required = true)
     private String namespace;
     @UriParam
+    @Metadata(autowired = true)
     private CloudWatchClient amazonCwClient;
     @UriParam(label = "security", secret = true)
     private String accessKey;
@@ -56,8 +57,6 @@ public class Cw2Configuration 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;
@@ -203,18 +202,6 @@ public class Cw2Configuration 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] 03/04: CAMEL-15836 - Camel-AWS2-Cloudwatch: enable autowire on the cloudwatch 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 12e09dbdaf65a1d9fad36c6e82bd495faa40cf4a
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Fri Nov 13 11:04:59 2020 +0100

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

diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/aws2-cw.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/aws2-cw.json
index 5b4c7f6..a632eab 100644
--- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/aws2-cw.json
+++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/aws2-cw.json
@@ -22,8 +22,7 @@
     "lenientProperties": false
   },
   "componentProperties": {
-    "amazonCwClient": { "kind": "property", "displayName": "Amazon Cw Client", "group": "producer", "label": "", "required": false, "type": "object", "javaType": "software.amazon.awssdk.services.cloudwatch.CloudWatchClient", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.cw.Cw2Configuration", "configurationField": "configuration", "description": "To use the AmazonCloudWatch 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.cw.Cw2Configuration", "configurationField": "configuration", "description": "Setting the autoDiscoverClient mechanism, if true, the component will look for a client instan [...]
+    "amazonCwClient": { "kind": "property", "displayName": "Amazon Cw Client", "group": "producer", "label": "", "required": false, "type": "object", "javaType": "software.amazon.awssdk.services.cloudwatch.CloudWatchClient", "deprecated": false, "deprecationNote": "", "autowired": true, "secret": false, "configurationClass": "org.apache.camel.component.aws2.cw.Cw2Configuration", "configurationField": "configuration", "description": "To use the AmazonCloudWatch as the client" },
     "configuration": { "kind": "property", "displayName": "Configuration", "group": "producer", "label": "", "required": false, "type": "object", "javaType": "org.apache.camel.component.aws2.cw.Cw2Configuration", "deprecated": false, "autowired": false, "secret": false, "description": "The component configuration" },
     "lazyStartProducer": { "kind": "property", "displayName": "Lazy Start Producer", "group": "producer", "label": "producer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during star [...]
     "name": { "kind": "property", "displayName": "Name", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.cw.Cw2Configuration", "configurationField": "configuration", "description": "The metric name" },
@@ -41,8 +40,7 @@
   },
   "properties": {
     "namespace": { "kind": "path", "displayName": "Namespace", "group": "producer", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.cw.Cw2Configuration", "configurationField": "configuration", "description": "The metric namespace" },
-    "amazonCwClient": { "kind": "parameter", "displayName": "Amazon Cw Client", "group": "producer", "label": "", "required": false, "type": "object", "javaType": "software.amazon.awssdk.services.cloudwatch.CloudWatchClient", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.cw.Cw2Configuration", "configurationField": "configuration", "description": "To use the AmazonCloudWatch 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.cw.Cw2Configuration", "configurationField": "configuration", "description": "Setting the autoDiscoverClient mechanism, if true, the component will look for a client insta [...]
+    "amazonCwClient": { "kind": "parameter", "displayName": "Amazon Cw Client", "group": "producer", "label": "", "required": false, "type": "object", "javaType": "software.amazon.awssdk.services.cloudwatch.CloudWatchClient", "deprecated": false, "deprecationNote": "", "autowired": true, "secret": false, "configurationClass": "org.apache.camel.component.aws2.cw.Cw2Configuration", "configurationField": "configuration", "description": "To use the AmazonCloudWatch as the client" },
     "lazyStartProducer": { "kind": "parameter", "displayName": "Lazy Start Producer", "group": "producer", "label": "producer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during sta [...]
     "name": { "kind": "parameter", "displayName": "Name", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.cw.Cw2Configuration", "configurationField": "configuration", "description": "The metric name" },
     "proxyHost": { "kind": "parameter", "displayName": "Proxy Host", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.cw.Cw2Configuration", "configurationField": "configuration", "description": "To define a proxy host when instantiating the CW client" },


[camel] 02/04: CAMEL-15836 - Camel-AWS2-Cloudwatch: enable autowire on the cloudwatch client, fixe tests and 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 a753c52ab13a2c807aa94e55f5cb102288fbe9be
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Fri Nov 13 09:18:32 2020 +0100

    CAMEL-15836 - Camel-AWS2-Cloudwatch: enable autowire on the cloudwatch client, fixe tests and regen
---
 .../camel/catalog/docs/aws2-cw-component.adoc      | 10 ++++----
 .../component/aws2/cw/Cw2ComponentConfigurer.java  | 11 ++++-----
 .../component/aws2/cw/Cw2EndpointConfigurer.java   | 11 ++++-----
 .../component/aws2/cw/Cw2EndpointUriFactory.java   |  3 +--
 .../apache/camel/component/aws2/cw/aws2-cw.json    |  6 ++---
 .../src/main/docs/aws2-cw-component.adoc           | 10 ++++----
 .../camel/component/aws2/cw/Cw2Component.java      |  3 ---
 .../aws2/cw/CwComponentRegistryClientTest.java     | 15 +-----------
 .../dsl/Aws2CwComponentBuilderFactory.java         | 16 -------------
 .../endpoint/dsl/Cw2EndpointBuilderFactory.java    | 28 ----------------------
 .../modules/ROOT/pages/aws2-cw-component.adoc      | 10 ++++----
 11 files changed, 26 insertions(+), 97 deletions(-)

diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/aws2-cw-component.adoc b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/aws2-cw-component.adoc
index c7190ff..1c23155 100644
--- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/aws2-cw-component.adoc
+++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/aws2-cw-component.adoc
@@ -45,15 +45,14 @@ The metrics will be created if they don't already exists. +
 
 
 // component options: START
-The AWS 2 CloudWatch component supports 16 options, which are listed below.
+The AWS 2 CloudWatch component supports 15 options, which are listed below.
 
 
 
 [width="100%",cols="2,5,^1,2",options="header"]
 |===
 | Name | Description | Default | Type
-| *amazonCwClient* (producer) | To use the AmazonCloudWatch as the client |  | CloudWatchClient
-| *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
+| *amazonCwClient* (producer) | *Autowired* To use the AmazonCloudWatch as the client |  | CloudWatchClient
 | *configuration* (producer) | The component configuration |  | Cw2Configuration
 | *lazyStartProducer* (producer) | Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and [...]
 | *name* (producer) | The metric name |  | String
@@ -93,14 +92,13 @@ with the following path and query parameters:
 |===
 
 
-=== Query Parameters (15 parameters):
+=== Query Parameters (14 parameters):
 
 
 [width="100%",cols="2,5,^1,2",options="header"]
 |===
 | Name | Description | Default | Type
-| *amazonCwClient* (producer) | To use the AmazonCloudWatch as the client |  | CloudWatchClient
-| *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
+| *amazonCwClient* (producer) | *Autowired* To use the AmazonCloudWatch as the client |  | CloudWatchClient
 | *lazyStartProducer* (producer) | Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and [...]
 | *name* (producer) | The metric name |  | String
 | *proxyHost* (producer) | To define a proxy host when instantiating the CW client |  | String
diff --git a/components/camel-aws2-cw/src/generated/java/org/apache/camel/component/aws2/cw/Cw2ComponentConfigurer.java b/components/camel-aws2-cw/src/generated/java/org/apache/camel/component/aws2/cw/Cw2ComponentConfigurer.java
index dda3869..785c5dc 100644
--- a/components/camel-aws2-cw/src/generated/java/org/apache/camel/component/aws2/cw/Cw2ComponentConfigurer.java
+++ b/components/camel-aws2-cw/src/generated/java/org/apache/camel/component/aws2/cw/Cw2ComponentConfigurer.java
@@ -32,8 +32,6 @@ public class Cw2ComponentConfigurer extends PropertyConfigurerSupport implements
         case "accessKey": getOrCreateConfiguration(target).setAccessKey(property(camelContext, java.lang.String.class, value)); return true;
         case "amazoncwclient":
         case "amazonCwClient": getOrCreateConfiguration(target).setAmazonCwClient(property(camelContext, software.amazon.awssdk.services.cloudwatch.CloudWatchClient.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.cw.Cw2Configuration.class, value)); return true;
@@ -59,14 +57,17 @@ public class Cw2ComponentConfigurer extends PropertyConfigurerSupport implements
     }
 
     @Override
+    public String[] getAutowiredNames() {
+        return new String[]{"amazonCwClient"};
+    }
+
+    @Override
     public Class<?> getOptionType(String name, boolean ignoreCase) {
         switch (ignoreCase ? name.toLowerCase() : name) {
         case "accesskey":
         case "accessKey": return java.lang.String.class;
         case "amazoncwclient":
         case "amazonCwClient": return software.amazon.awssdk.services.cloudwatch.CloudWatchClient.class;
-        case "autodiscoverclient":
-        case "autoDiscoverClient": return boolean.class;
         case "autowiredenabled":
         case "autowiredEnabled": return boolean.class;
         case "configuration": return org.apache.camel.component.aws2.cw.Cw2Configuration.class;
@@ -99,8 +100,6 @@ public class Cw2ComponentConfigurer extends PropertyConfigurerSupport implements
         case "accessKey": return getOrCreateConfiguration(target).getAccessKey();
         case "amazoncwclient":
         case "amazonCwClient": return getOrCreateConfiguration(target).getAmazonCwClient();
-        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-cw/src/generated/java/org/apache/camel/component/aws2/cw/Cw2EndpointConfigurer.java b/components/camel-aws2-cw/src/generated/java/org/apache/camel/component/aws2/cw/Cw2EndpointConfigurer.java
index 37b73ff..436990a 100644
--- a/components/camel-aws2-cw/src/generated/java/org/apache/camel/component/aws2/cw/Cw2EndpointConfigurer.java
+++ b/components/camel-aws2-cw/src/generated/java/org/apache/camel/component/aws2/cw/Cw2EndpointConfigurer.java
@@ -25,8 +25,6 @@ public class Cw2EndpointConfigurer extends PropertyConfigurerSupport implements
         case "accessKey": target.getConfiguration().setAccessKey(property(camelContext, java.lang.String.class, value)); return true;
         case "amazoncwclient":
         case "amazonCwClient": target.getConfiguration().setAmazonCwClient(property(camelContext, software.amazon.awssdk.services.cloudwatch.CloudWatchClient.class, value)); return true;
-        case "autodiscoverclient":
-        case "autoDiscoverClient": target.getConfiguration().setAutoDiscoverClient(property(camelContext, boolean.class, value)); return true;
         case "lazystartproducer":
         case "lazyStartProducer": target.setLazyStartProducer(property(camelContext, boolean.class, value)); return true;
         case "name": target.getConfiguration().setName(property(camelContext, java.lang.String.class, value)); return true;
@@ -50,14 +48,17 @@ public class Cw2EndpointConfigurer extends PropertyConfigurerSupport implements
     }
 
     @Override
+    public String[] getAutowiredNames() {
+        return new String[]{"amazonCwClient"};
+    }
+
+    @Override
     public Class<?> getOptionType(String name, boolean ignoreCase) {
         switch (ignoreCase ? name.toLowerCase() : name) {
         case "accesskey":
         case "accessKey": return java.lang.String.class;
         case "amazoncwclient":
         case "amazonCwClient": return software.amazon.awssdk.services.cloudwatch.CloudWatchClient.class;
-        case "autodiscoverclient":
-        case "autoDiscoverClient": return boolean.class;
         case "lazystartproducer":
         case "lazyStartProducer": return boolean.class;
         case "name": return java.lang.String.class;
@@ -88,8 +89,6 @@ public class Cw2EndpointConfigurer extends PropertyConfigurerSupport implements
         case "accessKey": return target.getConfiguration().getAccessKey();
         case "amazoncwclient":
         case "amazonCwClient": return target.getConfiguration().getAmazonCwClient();
-        case "autodiscoverclient":
-        case "autoDiscoverClient": return target.getConfiguration().isAutoDiscoverClient();
         case "lazystartproducer":
         case "lazyStartProducer": return target.isLazyStartProducer();
         case "name": return target.getConfiguration().getName();
diff --git a/components/camel-aws2-cw/src/generated/java/org/apache/camel/component/aws2/cw/Cw2EndpointUriFactory.java b/components/camel-aws2-cw/src/generated/java/org/apache/camel/component/aws2/cw/Cw2EndpointUriFactory.java
index 21671f2..b364370 100644
--- a/components/camel-aws2-cw/src/generated/java/org/apache/camel/component/aws2/cw/Cw2EndpointUriFactory.java
+++ b/components/camel-aws2-cw/src/generated/java/org/apache/camel/component/aws2/cw/Cw2EndpointUriFactory.java
@@ -20,8 +20,7 @@ public class Cw2EndpointUriFactory extends org.apache.camel.support.component.En
     private static final Set<String> PROPERTY_NAMES;
     private static final Set<String> SECRET_PROPERTY_NAMES;
     static {
-        Set<String> props = new HashSet<>(16);
-        props.add("autoDiscoverClient");
+        Set<String> props = new HashSet<>(15);
         props.add("proxyProtocol");
         props.add("secretKey");
         props.add("synchronous");
diff --git a/components/camel-aws2-cw/src/generated/resources/org/apache/camel/component/aws2/cw/aws2-cw.json b/components/camel-aws2-cw/src/generated/resources/org/apache/camel/component/aws2/cw/aws2-cw.json
index 5b4c7f6..a632eab 100644
--- a/components/camel-aws2-cw/src/generated/resources/org/apache/camel/component/aws2/cw/aws2-cw.json
+++ b/components/camel-aws2-cw/src/generated/resources/org/apache/camel/component/aws2/cw/aws2-cw.json
@@ -22,8 +22,7 @@
     "lenientProperties": false
   },
   "componentProperties": {
-    "amazonCwClient": { "kind": "property", "displayName": "Amazon Cw Client", "group": "producer", "label": "", "required": false, "type": "object", "javaType": "software.amazon.awssdk.services.cloudwatch.CloudWatchClient", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.cw.Cw2Configuration", "configurationField": "configuration", "description": "To use the AmazonCloudWatch 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.cw.Cw2Configuration", "configurationField": "configuration", "description": "Setting the autoDiscoverClient mechanism, if true, the component will look for a client instan [...]
+    "amazonCwClient": { "kind": "property", "displayName": "Amazon Cw Client", "group": "producer", "label": "", "required": false, "type": "object", "javaType": "software.amazon.awssdk.services.cloudwatch.CloudWatchClient", "deprecated": false, "deprecationNote": "", "autowired": true, "secret": false, "configurationClass": "org.apache.camel.component.aws2.cw.Cw2Configuration", "configurationField": "configuration", "description": "To use the AmazonCloudWatch as the client" },
     "configuration": { "kind": "property", "displayName": "Configuration", "group": "producer", "label": "", "required": false, "type": "object", "javaType": "org.apache.camel.component.aws2.cw.Cw2Configuration", "deprecated": false, "autowired": false, "secret": false, "description": "The component configuration" },
     "lazyStartProducer": { "kind": "property", "displayName": "Lazy Start Producer", "group": "producer", "label": "producer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during star [...]
     "name": { "kind": "property", "displayName": "Name", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.cw.Cw2Configuration", "configurationField": "configuration", "description": "The metric name" },
@@ -41,8 +40,7 @@
   },
   "properties": {
     "namespace": { "kind": "path", "displayName": "Namespace", "group": "producer", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.cw.Cw2Configuration", "configurationField": "configuration", "description": "The metric namespace" },
-    "amazonCwClient": { "kind": "parameter", "displayName": "Amazon Cw Client", "group": "producer", "label": "", "required": false, "type": "object", "javaType": "software.amazon.awssdk.services.cloudwatch.CloudWatchClient", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.cw.Cw2Configuration", "configurationField": "configuration", "description": "To use the AmazonCloudWatch 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.cw.Cw2Configuration", "configurationField": "configuration", "description": "Setting the autoDiscoverClient mechanism, if true, the component will look for a client insta [...]
+    "amazonCwClient": { "kind": "parameter", "displayName": "Amazon Cw Client", "group": "producer", "label": "", "required": false, "type": "object", "javaType": "software.amazon.awssdk.services.cloudwatch.CloudWatchClient", "deprecated": false, "deprecationNote": "", "autowired": true, "secret": false, "configurationClass": "org.apache.camel.component.aws2.cw.Cw2Configuration", "configurationField": "configuration", "description": "To use the AmazonCloudWatch as the client" },
     "lazyStartProducer": { "kind": "parameter", "displayName": "Lazy Start Producer", "group": "producer", "label": "producer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during sta [...]
     "name": { "kind": "parameter", "displayName": "Name", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.cw.Cw2Configuration", "configurationField": "configuration", "description": "The metric name" },
     "proxyHost": { "kind": "parameter", "displayName": "Proxy Host", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.cw.Cw2Configuration", "configurationField": "configuration", "description": "To define a proxy host when instantiating the CW client" },
diff --git a/components/camel-aws2-cw/src/main/docs/aws2-cw-component.adoc b/components/camel-aws2-cw/src/main/docs/aws2-cw-component.adoc
index c7190ff..1c23155 100644
--- a/components/camel-aws2-cw/src/main/docs/aws2-cw-component.adoc
+++ b/components/camel-aws2-cw/src/main/docs/aws2-cw-component.adoc
@@ -45,15 +45,14 @@ The metrics will be created if they don't already exists. +
 
 
 // component options: START
-The AWS 2 CloudWatch component supports 16 options, which are listed below.
+The AWS 2 CloudWatch component supports 15 options, which are listed below.
 
 
 
 [width="100%",cols="2,5,^1,2",options="header"]
 |===
 | Name | Description | Default | Type
-| *amazonCwClient* (producer) | To use the AmazonCloudWatch as the client |  | CloudWatchClient
-| *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
+| *amazonCwClient* (producer) | *Autowired* To use the AmazonCloudWatch as the client |  | CloudWatchClient
 | *configuration* (producer) | The component configuration |  | Cw2Configuration
 | *lazyStartProducer* (producer) | Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and [...]
 | *name* (producer) | The metric name |  | String
@@ -93,14 +92,13 @@ with the following path and query parameters:
 |===
 
 
-=== Query Parameters (15 parameters):
+=== Query Parameters (14 parameters):
 
 
 [width="100%",cols="2,5,^1,2",options="header"]
 |===
 | Name | Description | Default | Type
-| *amazonCwClient* (producer) | To use the AmazonCloudWatch as the client |  | CloudWatchClient
-| *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
+| *amazonCwClient* (producer) | *Autowired* To use the AmazonCloudWatch as the client |  | CloudWatchClient
 | *lazyStartProducer* (producer) | Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and [...]
 | *name* (producer) | The metric name |  | String
 | *proxyHost* (producer) | To define a proxy host when instantiating the CW client |  | String
diff --git a/components/camel-aws2-cw/src/main/java/org/apache/camel/component/aws2/cw/Cw2Component.java b/components/camel-aws2-cw/src/main/java/org/apache/camel/component/aws2/cw/Cw2Component.java
index ddaf518..e0336e6 100644
--- a/components/camel-aws2-cw/src/main/java/org/apache/camel/component/aws2/cw/Cw2Component.java
+++ b/components/camel-aws2-cw/src/main/java/org/apache/camel/component/aws2/cw/Cw2Component.java
@@ -17,17 +17,14 @@
 package org.apache.camel.component.aws2.cw;
 
 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.cloudwatch.CloudWatchClient;
 
 /**
  * For working with Amazon CloudWatch SDK v2.
diff --git a/components/camel-aws2-cw/src/test/java/org/apache/camel/component/aws2/cw/CwComponentRegistryClientTest.java b/components/camel-aws2-cw/src/test/java/org/apache/camel/component/aws2/cw/CwComponentRegistryClientTest.java
index c70f880..a4d71bc 100644
--- a/components/camel-aws2-cw/src/test/java/org/apache/camel/component/aws2/cw/CwComponentRegistryClientTest.java
+++ b/components/camel-aws2-cw/src/test/java/org/apache/camel/component/aws2/cw/CwComponentRegistryClientTest.java
@@ -24,7 +24,6 @@ import org.junit.jupiter.api.Test;
 import software.amazon.awssdk.services.cloudwatch.CloudWatchClient;
 
 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;
 
@@ -57,19 +56,7 @@ public class CwComponentRegistryClientTest extends CamelTestSupport {
     }
 
     @Test
-    public void createEndpointWithAutoDiscoverFalse() throws Exception {
-        CloudWatchClient cloudWatchClient = new CloudWatchClientMock();
-        context.getRegistry().bind("amazonCwClient", cloudWatchClient);
-        Cw2Component component = context.getComponent("aws2-cw", Cw2Component.class);
-        Cw2Endpoint endpoint = (Cw2Endpoint) component
-                .createEndpoint("aws2-cw://camel.apache.org/test?accessKey=xxx&secretKey=yyy&autoDiscoverClient=false");
-
-        assertEquals("camel.apache.org/test", endpoint.getConfiguration().getNamespace());
-        assertNotSame(cloudWatchClient, endpoint.getConfiguration().getAmazonCwClient());
-    }
-
-    @Test
-    public void createEndpointWithAutoDiscoverTrue() throws Exception {
+    public void createEndpointWithAutowire() throws Exception {
         CloudWatchClient cloudWatchClient = new CloudWatchClientMock();
         context.getRegistry().bind("amazonCwClient", cloudWatchClient);
         Cw2Component component = context.getComponent("aws2-cw", Cw2Component.class);
diff --git a/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/Aws2CwComponentBuilderFactory.java b/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/Aws2CwComponentBuilderFactory.java
index cad7840..74efcd4 100644
--- a/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/Aws2CwComponentBuilderFactory.java
+++ b/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/Aws2CwComponentBuilderFactory.java
@@ -60,21 +60,6 @@ public interface Aws2CwComponentBuilderFactory {
             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 Aws2CwComponentBuilder autoDiscoverClient(
-                boolean autoDiscoverClient) {
-            doSetProperty("autoDiscoverClient", autoDiscoverClient);
-            return this;
-        }
-        /**
          * The component configuration.
          * 
          * The option is a:
@@ -281,7 +266,6 @@ public interface Aws2CwComponentBuilderFactory {
                 Object value) {
             switch (name) {
             case "amazonCwClient": getOrCreateConfiguration((Cw2Component) component).setAmazonCwClient((software.amazon.awssdk.services.cloudwatch.CloudWatchClient) value); return true;
-            case "autoDiscoverClient": getOrCreateConfiguration((Cw2Component) component).setAutoDiscoverClient((boolean) value); return true;
             case "configuration": ((Cw2Component) component).setConfiguration((org.apache.camel.component.aws2.cw.Cw2Configuration) value); return true;
             case "lazyStartProducer": ((Cw2Component) component).setLazyStartProducer((boolean) value); return true;
             case "name": getOrCreateConfiguration((Cw2Component) component).setName((java.lang.String) value); return true;
diff --git a/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/Cw2EndpointBuilderFactory.java b/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/Cw2EndpointBuilderFactory.java
index bf82dc1..3a847ff 100644
--- a/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/Cw2EndpointBuilderFactory.java
+++ b/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/Cw2EndpointBuilderFactory.java
@@ -63,34 +63,6 @@ public interface Cw2EndpointBuilderFactory {
             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 Cw2EndpointBuilder 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 Cw2EndpointBuilder autoDiscoverClient(String autoDiscoverClient) {
-            doSetProperty("autoDiscoverClient", autoDiscoverClient);
-            return this;
-        }
-        /**
          * Whether the producer should be started lazy (on the first message).
          * By starting lazy you can use this to allow CamelContext and routes to
          * startup in situations where a producer may otherwise fail during
diff --git a/docs/components/modules/ROOT/pages/aws2-cw-component.adoc b/docs/components/modules/ROOT/pages/aws2-cw-component.adoc
index e0f8667..785b0d2 100644
--- a/docs/components/modules/ROOT/pages/aws2-cw-component.adoc
+++ b/docs/components/modules/ROOT/pages/aws2-cw-component.adoc
@@ -47,15 +47,14 @@ The metrics will be created if they don't already exists. +
 
 
 // component options: START
-The AWS 2 CloudWatch component supports 16 options, which are listed below.
+The AWS 2 CloudWatch component supports 15 options, which are listed below.
 
 
 
 [width="100%",cols="2,5,^1,2",options="header"]
 |===
 | Name | Description | Default | Type
-| *amazonCwClient* (producer) | To use the AmazonCloudWatch as the client |  | CloudWatchClient
-| *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
+| *amazonCwClient* (producer) | *Autowired* To use the AmazonCloudWatch as the client |  | CloudWatchClient
 | *configuration* (producer) | The component configuration |  | Cw2Configuration
 | *lazyStartProducer* (producer) | Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and [...]
 | *name* (producer) | The metric name |  | String
@@ -95,14 +94,13 @@ with the following path and query parameters:
 |===
 
 
-=== Query Parameters (15 parameters):
+=== Query Parameters (14 parameters):
 
 
 [width="100%",cols="2,5,^1,2",options="header"]
 |===
 | Name | Description | Default | Type
-| *amazonCwClient* (producer) | To use the AmazonCloudWatch as the client |  | CloudWatchClient
-| *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
+| *amazonCwClient* (producer) | *Autowired* To use the AmazonCloudWatch as the client |  | CloudWatchClient
 | *lazyStartProducer* (producer) | Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and [...]
 | *name* (producer) | The metric name |  | String
 | *proxyHost* (producer) | To define a proxy host when instantiating the CW client |  | String