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/14 17:45:08 UTC

[camel] branch master updated (de0c67c -> 0299b3c)

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 de0c67c  Sync deps
     new f65dc73  CAMEL-15836 - Camel-AWS2-MQ: enable autowire on the MQ client
     new a4d70f4  CAMEL-15836 - Camel-AWS2-MQ: enable autowire on the MQ client, regen component
     new 58ba7fe  CAMEL-15836 - Camel-AWS2-MQ: enable autowire on the MQ client, fixed test
     new 1707528  CAMEL-15836 - Camel-AWS2-MQ: enable autowire on the MQ client, regen catalog
     new 0299b3c  CAMEL-15836 - Camel-AWS2-MQ: enable autowire on the MQ client, added a note in the migration guide

The 5 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-mq.json   |  6 ++---
 .../camel/catalog/docs/aws2-mq-component.adoc      | 10 ++++----
 .../component/aws2/mq/MQ2ComponentConfigurer.java  | 11 ++++-----
 .../component/aws2/mq/MQ2EndpointConfigurer.java   | 11 ++++-----
 .../component/aws2/mq/MQ2EndpointUriFactory.java   |  3 +--
 .../apache/camel/component/aws2/mq/aws2-mq.json    |  6 ++---
 .../src/main/docs/aws2-mq-component.adoc           | 10 ++++----
 .../camel/component/aws2/mq/MQ2Component.java      | 21 ----------------
 .../camel/component/aws2/mq/MQ2Configuration.java  | 15 +-----------
 .../aws2/mq/MQComponentClientRegistryTest.java     | 13 ----------
 .../dsl/Aws2MqComponentBuilderFactory.java         | 16 -------------
 .../endpoint/dsl/MQ2EndpointBuilderFactory.java    | 28 ----------------------
 .../modules/ROOT/pages/aws2-mq-component.adoc      | 10 ++++----
 .../ROOT/pages/camel-3x-upgrade-guide-3_7.adoc     |  6 +++++
 14 files changed, 34 insertions(+), 132 deletions(-)


[camel] 05/05: CAMEL-15836 - Camel-AWS2-MQ: enable autowire on the MQ client, added a note in the 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 0299b3c37afef6f121a9f710859f9473d142246a
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Sat Nov 14 18:44:22 2020 +0100

    CAMEL-15836 - Camel-AWS2-MQ: enable autowire on the MQ client, added a note in the migration guide
---
 docs/user-manual/modules/ROOT/pages/camel-3x-upgrade-guide-3_7.adoc | 6 ++++++
 1 file changed, 6 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 09d91ae..560776a 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
@@ -181,3 +181,9 @@ In this context, it wasn't having any sense to maintain the autodiscoverClient o
 The camel-aws2-ec2 has now support for autowiring the amazonEc2Client option with Ec2Client 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-MQ Autowire support
+
+The camel-aws2-mq has now support for autowiring the amazonMqClient option with MqClient 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] 02/05: CAMEL-15836 - Camel-AWS2-MQ: enable autowire on the MQ 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 a4d70f464d2949b72eb13d2628a138e47e845882
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Sat Nov 14 18:34:00 2020 +0100

    CAMEL-15836 - Camel-AWS2-MQ: enable autowire on the MQ client, regen component
---
 .../camel/catalog/docs/aws2-mq-component.adoc      | 10 ++++----
 .../component/aws2/mq/MQ2ComponentConfigurer.java  | 11 ++++-----
 .../component/aws2/mq/MQ2EndpointConfigurer.java   | 11 ++++-----
 .../component/aws2/mq/MQ2EndpointUriFactory.java   |  3 +--
 .../apache/camel/component/aws2/mq/aws2-mq.json    |  6 ++---
 .../src/main/docs/aws2-mq-component.adoc           | 10 ++++----
 .../camel/component/aws2/mq/MQ2Configuration.java  |  2 +-
 .../dsl/Aws2MqComponentBuilderFactory.java         | 16 -------------
 .../endpoint/dsl/MQ2EndpointBuilderFactory.java    | 28 ----------------------
 .../modules/ROOT/pages/aws2-mq-component.adoc      | 10 ++++----
 10 files changed, 26 insertions(+), 81 deletions(-)

diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/aws2-mq-component.adoc b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/aws2-mq-component.adoc
index aa9acf4..9debaf0 100644
--- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/aws2-mq-component.adoc
+++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/aws2-mq-component.adoc
@@ -42,15 +42,14 @@ You can append query options to the URI in the following format,
 
 
 // component options: START
-The AWS 2 MQ component supports 14 options, which are listed below.
+The AWS 2 MQ component supports 13 options, which are listed below.
 
 
 
 [width="100%",cols="2,5,^1,2",options="header"]
 |===
 | Name | Description | Default | Type
-| *amazonMqClient* (producer) | To use a existing configured AmazonMQClient as client |  | MqClient
-| *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
+| *amazonMqClient* (producer) | *Autowired* To use a existing configured AmazonMQClient as client |  | MqClient
 | *configuration* (producer) | Component configuration |  | MQ2Configuration
 | *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 [...]
 | *operation* (producer) | *Required* The operation to perform. It can be listBrokers,createBroker,deleteBroker. There are 6 enums and the value can be one of: listBrokers, createBroker, deleteBroker, rebootBroker, updateBroker, describeBroker |  | MQ2Operations
@@ -88,14 +87,13 @@ with the following path and query parameters:
 |===
 
 
-=== Query Parameters (13 parameters):
+=== Query Parameters (12 parameters):
 
 
 [width="100%",cols="2,5,^1,2",options="header"]
 |===
 | Name | Description | Default | Type
-| *amazonMqClient* (producer) | To use a existing configured AmazonMQClient as client |  | MqClient
-| *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
+| *amazonMqClient* (producer) | *Autowired* To use a existing configured AmazonMQClient as client |  | MqClient
 | *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 [...]
 | *operation* (producer) | *Required* The operation to perform. It can be listBrokers,createBroker,deleteBroker. There are 6 enums and the value can be one of: listBrokers, createBroker, deleteBroker, rebootBroker, updateBroker, describeBroker |  | MQ2Operations
 | *pojoRequest* (producer) | If we want to use a POJO request as body or not | false | boolean
diff --git a/components/camel-aws2-mq/src/generated/java/org/apache/camel/component/aws2/mq/MQ2ComponentConfigurer.java b/components/camel-aws2-mq/src/generated/java/org/apache/camel/component/aws2/mq/MQ2ComponentConfigurer.java
index 0cc59d7..3c15462 100644
--- a/components/camel-aws2-mq/src/generated/java/org/apache/camel/component/aws2/mq/MQ2ComponentConfigurer.java
+++ b/components/camel-aws2-mq/src/generated/java/org/apache/camel/component/aws2/mq/MQ2ComponentConfigurer.java
@@ -32,8 +32,6 @@ public class MQ2ComponentConfigurer extends PropertyConfigurerSupport implements
         case "accessKey": getOrCreateConfiguration(target).setAccessKey(property(camelContext, java.lang.String.class, value)); return true;
         case "amazonmqclient":
         case "amazonMqClient": getOrCreateConfiguration(target).setAmazonMqClient(property(camelContext, software.amazon.awssdk.services.mq.MqClient.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.mq.MQ2Configuration.class, value)); return true;
@@ -58,14 +56,17 @@ public class MQ2ComponentConfigurer extends PropertyConfigurerSupport implements
     }
 
     @Override
+    public String[] getAutowiredNames() {
+        return new String[]{"amazonMqClient"};
+    }
+
+    @Override
     public Class<?> getOptionType(String name, boolean ignoreCase) {
         switch (ignoreCase ? name.toLowerCase() : name) {
         case "accesskey":
         case "accessKey": return java.lang.String.class;
         case "amazonmqclient":
         case "amazonMqClient": return software.amazon.awssdk.services.mq.MqClient.class;
-        case "autodiscoverclient":
-        case "autoDiscoverClient": return boolean.class;
         case "autowiredenabled":
         case "autowiredEnabled": return boolean.class;
         case "configuration": return org.apache.camel.component.aws2.mq.MQ2Configuration.class;
@@ -97,8 +98,6 @@ public class MQ2ComponentConfigurer extends PropertyConfigurerSupport implements
         case "accessKey": return getOrCreateConfiguration(target).getAccessKey();
         case "amazonmqclient":
         case "amazonMqClient": return getOrCreateConfiguration(target).getAmazonMqClient();
-        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-mq/src/generated/java/org/apache/camel/component/aws2/mq/MQ2EndpointConfigurer.java b/components/camel-aws2-mq/src/generated/java/org/apache/camel/component/aws2/mq/MQ2EndpointConfigurer.java
index d207be5..79b6547 100644
--- a/components/camel-aws2-mq/src/generated/java/org/apache/camel/component/aws2/mq/MQ2EndpointConfigurer.java
+++ b/components/camel-aws2-mq/src/generated/java/org/apache/camel/component/aws2/mq/MQ2EndpointConfigurer.java
@@ -25,8 +25,6 @@ public class MQ2EndpointConfigurer extends PropertyConfigurerSupport implements
         case "accessKey": target.getConfiguration().setAccessKey(property(camelContext, java.lang.String.class, value)); return true;
         case "amazonmqclient":
         case "amazonMqClient": target.getConfiguration().setAmazonMqClient(property(camelContext, software.amazon.awssdk.services.mq.MqClient.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 "operation": target.getConfiguration().setOperation(property(camelContext, org.apache.camel.component.aws2.mq.MQ2Operations.class, value)); return true;
@@ -49,14 +47,17 @@ public class MQ2EndpointConfigurer extends PropertyConfigurerSupport implements
     }
 
     @Override
+    public String[] getAutowiredNames() {
+        return new String[]{"amazonMqClient"};
+    }
+
+    @Override
     public Class<?> getOptionType(String name, boolean ignoreCase) {
         switch (ignoreCase ? name.toLowerCase() : name) {
         case "accesskey":
         case "accessKey": return java.lang.String.class;
         case "amazonmqclient":
         case "amazonMqClient": return software.amazon.awssdk.services.mq.MqClient.class;
-        case "autodiscoverclient":
-        case "autoDiscoverClient": return boolean.class;
         case "lazystartproducer":
         case "lazyStartProducer": return boolean.class;
         case "operation": return org.apache.camel.component.aws2.mq.MQ2Operations.class;
@@ -86,8 +87,6 @@ public class MQ2EndpointConfigurer extends PropertyConfigurerSupport implements
         case "accessKey": return target.getConfiguration().getAccessKey();
         case "amazonmqclient":
         case "amazonMqClient": return target.getConfiguration().getAmazonMqClient();
-        case "autodiscoverclient":
-        case "autoDiscoverClient": return target.getConfiguration().isAutoDiscoverClient();
         case "lazystartproducer":
         case "lazyStartProducer": return target.isLazyStartProducer();
         case "operation": return target.getConfiguration().getOperation();
diff --git a/components/camel-aws2-mq/src/generated/java/org/apache/camel/component/aws2/mq/MQ2EndpointUriFactory.java b/components/camel-aws2-mq/src/generated/java/org/apache/camel/component/aws2/mq/MQ2EndpointUriFactory.java
index 00be8fc..2d03829 100644
--- a/components/camel-aws2-mq/src/generated/java/org/apache/camel/component/aws2/mq/MQ2EndpointUriFactory.java
+++ b/components/camel-aws2-mq/src/generated/java/org/apache/camel/component/aws2/mq/MQ2EndpointUriFactory.java
@@ -20,9 +20,8 @@ public class MQ2EndpointUriFactory 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<>(14);
+        Set<String> props = new HashSet<>(13);
         props.add("amazonMqClient");
-        props.add("autoDiscoverClient");
         props.add("proxyProtocol");
         props.add("secretKey");
         props.add("synchronous");
diff --git a/components/camel-aws2-mq/src/generated/resources/org/apache/camel/component/aws2/mq/aws2-mq.json b/components/camel-aws2-mq/src/generated/resources/org/apache/camel/component/aws2/mq/aws2-mq.json
index 019ee258..56a283f 100644
--- a/components/camel-aws2-mq/src/generated/resources/org/apache/camel/component/aws2/mq/aws2-mq.json
+++ b/components/camel-aws2-mq/src/generated/resources/org/apache/camel/component/aws2/mq/aws2-mq.json
@@ -22,8 +22,7 @@
     "lenientProperties": false
   },
   "componentProperties": {
-    "amazonMqClient": { "kind": "property", "displayName": "Amazon Mq Client", "group": "producer", "label": "", "required": false, "type": "object", "javaType": "software.amazon.awssdk.services.mq.MqClient", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.mq.MQ2Configuration", "configurationField": "configuration", "description": "To use a existing configured AmazonMQClient as 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.mq.MQ2Configuration", "configurationField": "configuration", "description": "Setting the autoDiscoverClient mechanism, if true, the component will look for a client instan [...]
+    "amazonMqClient": { "kind": "property", "displayName": "Amazon Mq Client", "group": "producer", "label": "", "required": false, "type": "object", "javaType": "software.amazon.awssdk.services.mq.MqClient", "deprecated": false, "deprecationNote": "", "autowired": true, "secret": false, "configurationClass": "org.apache.camel.component.aws2.mq.MQ2Configuration", "configurationField": "configuration", "description": "To use a existing configured AmazonMQClient as client" },
     "configuration": { "kind": "property", "displayName": "Configuration", "group": "producer", "label": "", "required": false, "type": "object", "javaType": "org.apache.camel.component.aws2.mq.MQ2Configuration", "deprecated": false, "autowired": false, "secret": false, "description": "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 [...]
     "operation": { "kind": "property", "displayName": "Operation", "group": "producer", "label": "", "required": true, "type": "object", "javaType": "org.apache.camel.component.aws2.mq.MQ2Operations", "enum": [ "listBrokers", "createBroker", "deleteBroker", "rebootBroker", "updateBroker", "describeBroker" ], "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.mq.MQ2Configuration", "configurationField": "c [...]
@@ -39,8 +38,7 @@
   },
   "properties": {
     "label": { "kind": "path", "displayName": "Label", "group": "producer", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.mq.MQ2Configuration", "configurationField": "configuration", "description": "Logical name" },
-    "amazonMqClient": { "kind": "parameter", "displayName": "Amazon Mq Client", "group": "producer", "label": "", "required": false, "type": "object", "javaType": "software.amazon.awssdk.services.mq.MqClient", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.mq.MQ2Configuration", "configurationField": "configuration", "description": "To use a existing configured AmazonMQClient as 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.mq.MQ2Configuration", "configurationField": "configuration", "description": "Setting the autoDiscoverClient mechanism, if true, the component will look for a client insta [...]
+    "amazonMqClient": { "kind": "parameter", "displayName": "Amazon Mq Client", "group": "producer", "label": "", "required": false, "type": "object", "javaType": "software.amazon.awssdk.services.mq.MqClient", "deprecated": false, "deprecationNote": "", "autowired": true, "secret": false, "configurationClass": "org.apache.camel.component.aws2.mq.MQ2Configuration", "configurationField": "configuration", "description": "To use a existing configured AmazonMQClient as 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 [...]
     "operation": { "kind": "parameter", "displayName": "Operation", "group": "producer", "label": "", "required": true, "type": "object", "javaType": "org.apache.camel.component.aws2.mq.MQ2Operations", "enum": [ "listBrokers", "createBroker", "deleteBroker", "rebootBroker", "updateBroker", "describeBroker" ], "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.mq.MQ2Configuration", "configurationField": " [...]
     "pojoRequest": { "kind": "parameter", "displayName": "Pojo Request", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.aws2.mq.MQ2Configuration", "configurationField": "configuration", "description": "If we want to use a POJO request as body or not" },
diff --git a/components/camel-aws2-mq/src/main/docs/aws2-mq-component.adoc b/components/camel-aws2-mq/src/main/docs/aws2-mq-component.adoc
index aa9acf4..9debaf0 100644
--- a/components/camel-aws2-mq/src/main/docs/aws2-mq-component.adoc
+++ b/components/camel-aws2-mq/src/main/docs/aws2-mq-component.adoc
@@ -42,15 +42,14 @@ You can append query options to the URI in the following format,
 
 
 // component options: START
-The AWS 2 MQ component supports 14 options, which are listed below.
+The AWS 2 MQ component supports 13 options, which are listed below.
 
 
 
 [width="100%",cols="2,5,^1,2",options="header"]
 |===
 | Name | Description | Default | Type
-| *amazonMqClient* (producer) | To use a existing configured AmazonMQClient as client |  | MqClient
-| *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
+| *amazonMqClient* (producer) | *Autowired* To use a existing configured AmazonMQClient as client |  | MqClient
 | *configuration* (producer) | Component configuration |  | MQ2Configuration
 | *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 [...]
 | *operation* (producer) | *Required* The operation to perform. It can be listBrokers,createBroker,deleteBroker. There are 6 enums and the value can be one of: listBrokers, createBroker, deleteBroker, rebootBroker, updateBroker, describeBroker |  | MQ2Operations
@@ -88,14 +87,13 @@ with the following path and query parameters:
 |===
 
 
-=== Query Parameters (13 parameters):
+=== Query Parameters (12 parameters):
 
 
 [width="100%",cols="2,5,^1,2",options="header"]
 |===
 | Name | Description | Default | Type
-| *amazonMqClient* (producer) | To use a existing configured AmazonMQClient as client |  | MqClient
-| *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
+| *amazonMqClient* (producer) | *Autowired* To use a existing configured AmazonMQClient as client |  | MqClient
 | *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 [...]
 | *operation* (producer) | *Required* The operation to perform. It can be listBrokers,createBroker,deleteBroker. There are 6 enums and the value can be one of: listBrokers, createBroker, deleteBroker, rebootBroker, updateBroker, describeBroker |  | MQ2Operations
 | *pojoRequest* (producer) | If we want to use a POJO request as body or not | false | boolean
diff --git a/components/camel-aws2-mq/src/main/java/org/apache/camel/component/aws2/mq/MQ2Configuration.java b/components/camel-aws2-mq/src/main/java/org/apache/camel/component/aws2/mq/MQ2Configuration.java
index 0119509..1cee73a 100644
--- a/components/camel-aws2-mq/src/main/java/org/apache/camel/component/aws2/mq/MQ2Configuration.java
+++ b/components/camel-aws2-mq/src/main/java/org/apache/camel/component/aws2/mq/MQ2Configuration.java
@@ -31,7 +31,7 @@ public class MQ2Configuration implements Cloneable {
     @Metadata(required = true)
     private String label;
     @UriParam
-    @Metadata(autowired = true)    
+    @Metadata(autowired = true)
     private MqClient amazonMqClient;
     @UriParam(label = "security", secret = true)
     private String accessKey;
diff --git a/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/Aws2MqComponentBuilderFactory.java b/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/Aws2MqComponentBuilderFactory.java
index 2e0b6e3..305496d 100644
--- a/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/Aws2MqComponentBuilderFactory.java
+++ b/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/Aws2MqComponentBuilderFactory.java
@@ -60,21 +60,6 @@ public interface Aws2MqComponentBuilderFactory {
             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 Aws2MqComponentBuilder autoDiscoverClient(
-                boolean autoDiscoverClient) {
-            doSetProperty("autoDiscoverClient", autoDiscoverClient);
-            return this;
-        }
-        /**
          * Component configuration.
          * 
          * The option is a:
@@ -263,7 +248,6 @@ public interface Aws2MqComponentBuilderFactory {
                 Object value) {
             switch (name) {
             case "amazonMqClient": getOrCreateConfiguration((MQ2Component) component).setAmazonMqClient((software.amazon.awssdk.services.mq.MqClient) value); return true;
-            case "autoDiscoverClient": getOrCreateConfiguration((MQ2Component) component).setAutoDiscoverClient((boolean) value); return true;
             case "configuration": ((MQ2Component) component).setConfiguration((org.apache.camel.component.aws2.mq.MQ2Configuration) value); return true;
             case "lazyStartProducer": ((MQ2Component) component).setLazyStartProducer((boolean) value); return true;
             case "operation": getOrCreateConfiguration((MQ2Component) component).setOperation((org.apache.camel.component.aws2.mq.MQ2Operations) value); return true;
diff --git a/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/MQ2EndpointBuilderFactory.java b/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/MQ2EndpointBuilderFactory.java
index d50791d..8d9b8f6 100644
--- a/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/MQ2EndpointBuilderFactory.java
+++ b/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/MQ2EndpointBuilderFactory.java
@@ -62,34 +62,6 @@ public interface MQ2EndpointBuilderFactory {
             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 MQ2EndpointBuilder 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 MQ2EndpointBuilder 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-mq-component.adoc b/docs/components/modules/ROOT/pages/aws2-mq-component.adoc
index eb6ad69..aac4ed6 100644
--- a/docs/components/modules/ROOT/pages/aws2-mq-component.adoc
+++ b/docs/components/modules/ROOT/pages/aws2-mq-component.adoc
@@ -44,15 +44,14 @@ You can append query options to the URI in the following format,
 
 
 // component options: START
-The AWS 2 MQ component supports 14 options, which are listed below.
+The AWS 2 MQ component supports 13 options, which are listed below.
 
 
 
 [width="100%",cols="2,5,^1,2",options="header"]
 |===
 | Name | Description | Default | Type
-| *amazonMqClient* (producer) | To use a existing configured AmazonMQClient as client |  | MqClient
-| *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
+| *amazonMqClient* (producer) | *Autowired* To use a existing configured AmazonMQClient as client |  | MqClient
 | *configuration* (producer) | Component configuration |  | MQ2Configuration
 | *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 [...]
 | *operation* (producer) | *Required* The operation to perform. It can be listBrokers,createBroker,deleteBroker. There are 6 enums and the value can be one of: listBrokers, createBroker, deleteBroker, rebootBroker, updateBroker, describeBroker |  | MQ2Operations
@@ -90,14 +89,13 @@ with the following path and query parameters:
 |===
 
 
-=== Query Parameters (13 parameters):
+=== Query Parameters (12 parameters):
 
 
 [width="100%",cols="2,5,^1,2",options="header"]
 |===
 | Name | Description | Default | Type
-| *amazonMqClient* (producer) | To use a existing configured AmazonMQClient as client |  | MqClient
-| *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
+| *amazonMqClient* (producer) | *Autowired* To use a existing configured AmazonMQClient as client |  | MqClient
 | *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 [...]
 | *operation* (producer) | *Required* The operation to perform. It can be listBrokers,createBroker,deleteBroker. There are 6 enums and the value can be one of: listBrokers, createBroker, deleteBroker, rebootBroker, updateBroker, describeBroker |  | MQ2Operations
 | *pojoRequest* (producer) | If we want to use a POJO request as body or not | false | boolean


[camel] 03/05: CAMEL-15836 - Camel-AWS2-MQ: enable autowire on the MQ client, fixed 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 58ba7fed303cd8cded280d354e5b7a6ad8c29c21
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Sat Nov 14 18:34:44 2020 +0100

    CAMEL-15836 - Camel-AWS2-MQ: enable autowire on the MQ client, fixed test
---
 .../component/aws2/mq/MQComponentClientRegistryTest.java    | 13 -------------
 1 file changed, 13 deletions(-)

diff --git a/components/camel-aws2-mq/src/test/java/org/apache/camel/component/aws2/mq/MQComponentClientRegistryTest.java b/components/camel-aws2-mq/src/test/java/org/apache/camel/component/aws2/mq/MQComponentClientRegistryTest.java
index 22be146..64ddf47 100644
--- a/components/camel-aws2-mq/src/test/java/org/apache/camel/component/aws2/mq/MQComponentClientRegistryTest.java
+++ b/components/camel-aws2-mq/src/test/java/org/apache/camel/component/aws2/mq/MQComponentClientRegistryTest.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.assertNotNull;
-import static org.junit.jupiter.api.Assertions.assertNotSame;
 import static org.junit.jupiter.api.Assertions.assertSame;
 import static org.junit.jupiter.api.Assertions.assertThrows;
 
@@ -47,18 +46,6 @@ public class MQComponentClientRegistryTest extends CamelTestSupport {
     }
 
     @Test
-    public void createEndpointWithAutoDiscoverFalse() throws Exception {
-
-        AmazonMQClientMock awsMQClient = new AmazonMQClientMock();
-        context.getRegistry().bind("awsMQClient", awsMQClient);
-        MQ2Component component = context.getComponent("aws2-mq", MQ2Component.class);
-        MQ2Endpoint endpoint = (MQ2Endpoint) component
-                .createEndpoint("aws2-mq://MyQueue?accessKey=xxx&secretKey=yyy&autoDiscoverClient=false");
-
-        assertNotSame(awsMQClient, endpoint.getConfiguration().getAmazonMqClient());
-    }
-
-    @Test
     public void createEndpointWithAutoDiscoverTrue() throws Exception {
 
         AmazonMQClientMock awsMQClient = new AmazonMQClientMock();


[camel] 04/05: CAMEL-15836 - Camel-AWS2-MQ: enable autowire on the MQ 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 17075287ee66a1e7d032877a777351e2dcf8e9aa
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Sat Nov 14 18:42:20 2020 +0100

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

diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/aws2-mq.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/aws2-mq.json
index 019ee258..56a283f 100644
--- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/aws2-mq.json
+++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/aws2-mq.json
@@ -22,8 +22,7 @@
     "lenientProperties": false
   },
   "componentProperties": {
-    "amazonMqClient": { "kind": "property", "displayName": "Amazon Mq Client", "group": "producer", "label": "", "required": false, "type": "object", "javaType": "software.amazon.awssdk.services.mq.MqClient", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.mq.MQ2Configuration", "configurationField": "configuration", "description": "To use a existing configured AmazonMQClient as 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.mq.MQ2Configuration", "configurationField": "configuration", "description": "Setting the autoDiscoverClient mechanism, if true, the component will look for a client instan [...]
+    "amazonMqClient": { "kind": "property", "displayName": "Amazon Mq Client", "group": "producer", "label": "", "required": false, "type": "object", "javaType": "software.amazon.awssdk.services.mq.MqClient", "deprecated": false, "deprecationNote": "", "autowired": true, "secret": false, "configurationClass": "org.apache.camel.component.aws2.mq.MQ2Configuration", "configurationField": "configuration", "description": "To use a existing configured AmazonMQClient as client" },
     "configuration": { "kind": "property", "displayName": "Configuration", "group": "producer", "label": "", "required": false, "type": "object", "javaType": "org.apache.camel.component.aws2.mq.MQ2Configuration", "deprecated": false, "autowired": false, "secret": false, "description": "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 [...]
     "operation": { "kind": "property", "displayName": "Operation", "group": "producer", "label": "", "required": true, "type": "object", "javaType": "org.apache.camel.component.aws2.mq.MQ2Operations", "enum": [ "listBrokers", "createBroker", "deleteBroker", "rebootBroker", "updateBroker", "describeBroker" ], "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.mq.MQ2Configuration", "configurationField": "c [...]
@@ -39,8 +38,7 @@
   },
   "properties": {
     "label": { "kind": "path", "displayName": "Label", "group": "producer", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.mq.MQ2Configuration", "configurationField": "configuration", "description": "Logical name" },
-    "amazonMqClient": { "kind": "parameter", "displayName": "Amazon Mq Client", "group": "producer", "label": "", "required": false, "type": "object", "javaType": "software.amazon.awssdk.services.mq.MqClient", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.mq.MQ2Configuration", "configurationField": "configuration", "description": "To use a existing configured AmazonMQClient as 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.mq.MQ2Configuration", "configurationField": "configuration", "description": "Setting the autoDiscoverClient mechanism, if true, the component will look for a client insta [...]
+    "amazonMqClient": { "kind": "parameter", "displayName": "Amazon Mq Client", "group": "producer", "label": "", "required": false, "type": "object", "javaType": "software.amazon.awssdk.services.mq.MqClient", "deprecated": false, "deprecationNote": "", "autowired": true, "secret": false, "configurationClass": "org.apache.camel.component.aws2.mq.MQ2Configuration", "configurationField": "configuration", "description": "To use a existing configured AmazonMQClient as 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 [...]
     "operation": { "kind": "parameter", "displayName": "Operation", "group": "producer", "label": "", "required": true, "type": "object", "javaType": "org.apache.camel.component.aws2.mq.MQ2Operations", "enum": [ "listBrokers", "createBroker", "deleteBroker", "rebootBroker", "updateBroker", "describeBroker" ], "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.mq.MQ2Configuration", "configurationField": " [...]
     "pojoRequest": { "kind": "parameter", "displayName": "Pojo Request", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.aws2.mq.MQ2Configuration", "configurationField": "configuration", "description": "If we want to use a POJO request as body or not" },


[camel] 01/05: CAMEL-15836 - Camel-AWS2-MQ: enable autowire on the MQ 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 f65dc73b73300798905cf6fe24b6a212b983f207
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Sat Nov 14 18:31:53 2020 +0100

    CAMEL-15836 - Camel-AWS2-MQ: enable autowire on the MQ client
---
 .../camel/component/aws2/mq/MQ2Component.java       | 21 ---------------------
 .../camel/component/aws2/mq/MQ2Configuration.java   | 15 +--------------
 2 files changed, 1 insertion(+), 35 deletions(-)

diff --git a/components/camel-aws2-mq/src/main/java/org/apache/camel/component/aws2/mq/MQ2Component.java b/components/camel-aws2-mq/src/main/java/org/apache/camel/component/aws2/mq/MQ2Component.java
index 2d71eda..f090191 100644
--- a/components/camel-aws2-mq/src/main/java/org/apache/camel/component/aws2/mq/MQ2Component.java
+++ b/components/camel-aws2-mq/src/main/java/org/apache/camel/component/aws2/mq/MQ2Component.java
@@ -17,17 +17,14 @@
 package org.apache.camel.component.aws2.mq;
 
 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.mq.MqClient;
 
 /**
  * For working with Amazon MQ SDK v2.
@@ -55,9 +52,6 @@ public class MQ2Component extends DefaultComponent {
         MQ2Configuration configuration = this.configuration != null ? this.configuration.copy() : new MQ2Configuration();
         MQ2Endpoint endpoint = new MQ2Endpoint(uri, this, configuration);
         setProperties(endpoint, parameters);
-        if (endpoint.getConfiguration().isAutoDiscoverClient()) {
-            checkAndSetRegistryClient(configuration, endpoint);
-        }
         if (configuration.getAmazonMqClient() == null
                 && (configuration.getAccessKey() == null || configuration.getSecretKey() == null)) {
             throw new IllegalArgumentException("amazonMQClient or accessKey and secretKey must be specified");
@@ -76,19 +70,4 @@ public class MQ2Component extends DefaultComponent {
     public void setConfiguration(MQ2Configuration configuration) {
         this.configuration = configuration;
     }
-
-    private void checkAndSetRegistryClient(MQ2Configuration configuration, MQ2Endpoint endpoint) {
-        if (ObjectHelper.isEmpty(endpoint.getConfiguration().getAmazonMqClient())) {
-            LOG.debug("Looking for an MqClient instance in the registry");
-            Set<MqClient> clients = getCamelContext().getRegistry().findByType(MqClient.class);
-            if (clients.size() == 1) {
-                LOG.debug("Found exactly one MqClient instance in the registry");
-                configuration.setAmazonMqClient(clients.stream().findFirst().get());
-            } else {
-                LOG.debug("No MqClient instance in the registry");
-            }
-        } else {
-            LOG.debug("MqClient instance is already set at endpoint level: skipping the check in the registry");
-        }
-    }
 }
diff --git a/components/camel-aws2-mq/src/main/java/org/apache/camel/component/aws2/mq/MQ2Configuration.java b/components/camel-aws2-mq/src/main/java/org/apache/camel/component/aws2/mq/MQ2Configuration.java
index e025984..0119509 100644
--- a/components/camel-aws2-mq/src/main/java/org/apache/camel/component/aws2/mq/MQ2Configuration.java
+++ b/components/camel-aws2-mq/src/main/java/org/apache/camel/component/aws2/mq/MQ2Configuration.java
@@ -31,6 +31,7 @@ public class MQ2Configuration implements Cloneable {
     @Metadata(required = true)
     private String label;
     @UriParam
+    @Metadata(autowired = true)    
     private MqClient amazonMqClient;
     @UriParam(label = "security", secret = true)
     private String accessKey;
@@ -51,8 +52,6 @@ public class MQ2Configuration implements Cloneable {
     private boolean pojoRequest;
     @UriParam(defaultValue = "false")
     private boolean trustAllCertificates;
-    @UriParam(label = "common", defaultValue = "true")
-    private boolean autoDiscoverClient = true;
 
     public MqClient getAmazonMqClient() {
         return amazonMqClient;
@@ -165,18 +164,6 @@ public class MQ2Configuration 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;
-    }
-
     // *************************************************
     //
     // *************************************************