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/07/24 12:12:03 UTC

[camel] branch master updated (4ea4784 -> d6b8f60)

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 4ea4784  REgen catalog
     new 23d32b7  CAMEL-15310 - AWS* - Support for more than 1 client in the registry - Camel-AWS-MSK
     new 86dfe7a  Regen website docs
     new 3ad2544  Regen catalog
     new 9c4a443  CAMEL-15310 - AWS* - Support for more than 1 client in the registry - Camel-AWS2-MSK
     new 2051814  Regen website docs
     new d6b8f60  Regen catalog

The 6 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/aws-msk.json   |  2 ++
 .../apache/camel/catalog/components/aws2-msk.json  |  2 ++
 .../camel/catalog/docs/aws-msk-component.adoc      |  6 +++--
 .../camel/catalog/docs/aws2-msk-component.adoc     |  6 +++--
 .../component/aws/msk/MSKComponentConfigurer.java  |  5 ++++
 .../component/aws/msk/MSKEndpointConfigurer.java   |  5 ++++
 .../apache/camel/component/aws/msk/aws-msk.json    |  2 ++
 .../src/main/docs/aws-msk-component.adoc           |  6 +++--
 .../camel/component/aws/msk/MSKComponent.java      |  4 ++-
 .../camel/component/aws/msk/MSKConfiguration.java  | 15 +++++++++++
 .../aws/msk/MSKComponentClientRegistryTest.java    | 24 ++++++++++++++++++
 .../aws2/msk/MSK2ComponentConfigurer.java          |  5 ++++
 .../component/aws2/msk/MSK2EndpointConfigurer.java |  5 ++++
 .../apache/camel/component/aws2/msk/aws2-msk.json  |  2 ++
 .../src/main/docs/aws2-msk-component.adoc          |  6 +++--
 .../camel/component/aws2/msk/MSK2Component.java    |  4 ++-
 .../component/aws2/msk/MSK2Configuration.java      | 16 ++++++++++++
 .../aws2/msk/MSKComponentClientRegistryTest.java   | 24 ++++++++++++++++++
 .../dsl/Aws2MskComponentBuilderFactory.java        | 16 ++++++++++++
 .../dsl/AwsMskComponentBuilderFactory.java         | 16 ++++++++++++
 .../builder/endpoint/StaticEndpointBuilders.java   |  8 +++---
 .../endpoint/dsl/MSK2EndpointBuilderFactory.java   | 29 ++++++++++++++++++++++
 .../endpoint/dsl/MSKEndpointBuilderFactory.java    | 28 +++++++++++++++++++++
 .../modules/ROOT/pages/aws-msk-component.adoc      |  6 +++--
 .../modules/ROOT/pages/aws2-msk-component.adoc     |  6 +++--
 25 files changed, 230 insertions(+), 18 deletions(-)


[camel] 02/06: Regen website docs

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 86dfe7a7287c063350c16ffaee7e09e7bd565bc2
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Fri Jul 24 14:04:49 2020 +0200

    Regen website docs
---
 docs/components/modules/ROOT/pages/aws-msk-component.adoc | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/docs/components/modules/ROOT/pages/aws-msk-component.adoc b/docs/components/modules/ROOT/pages/aws-msk-component.adoc
index d2b742f..585fbb3 100644
--- a/docs/components/modules/ROOT/pages/aws-msk-component.adoc
+++ b/docs/components/modules/ROOT/pages/aws-msk-component.adoc
@@ -38,13 +38,14 @@ You can append query options to the URI in the following format,
 
 
 // component options: START
-The AWS Managed Streaming for Apache Kafka (MSK) component supports 11 options, which are listed below.
+The AWS Managed Streaming for Apache Kafka (MSK) component supports 12 options, which are listed below.
 
 
 
 [width="100%",cols="2,5,^1,2",options="header"]
 |===
 | Name | Description | Default | Type
+| *autoDiscoverClient* (common) | Setting the autoDiscoverClient mechanism, if true, the component will look for a client instance in the registry automatically otherwise it will skip that checking. | true | boolean
 | *accessKey* (producer) | Amazon AWS Access Key |  | String
 | *configuration* (producer) | The component configuration |  | MSKConfiguration
 | *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 [...]
@@ -81,12 +82,13 @@ with the following path and query parameters:
 |===
 
 
-=== Query Parameters (11 parameters):
+=== Query Parameters (12 parameters):
 
 
 [width="100%",cols="2,5,^1,2",options="header"]
 |===
 | Name | Description | Default | Type
+| *autoDiscoverClient* (common) | Setting the autoDiscoverClient mechanism, if true, the component will look for a client instance in the registry automatically otherwise it will skip that checking. | true | boolean
 | *accessKey* (producer) | Amazon AWS Access Key |  | String
 | *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 [...]
 | *mskClient* (producer) | To use a existing configured AWS MSK as client |  | AWSKafka


[camel] 03/06: 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 3ad2544a1dd2bb8598e9293b430a51bcb47e1283
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Fri Jul 24 14:05:17 2020 +0200

    Regen catalog
---
 .../resources/org/apache/camel/catalog/components/aws-msk.json      | 2 ++
 .../resources/org/apache/camel/catalog/docs/aws-msk-component.adoc  | 6 ++++--
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/aws-msk.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/aws-msk.json
index 81a8a22..03c1fca 100644
--- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/aws-msk.json
+++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/aws-msk.json
@@ -21,6 +21,7 @@
     "lenientProperties": false
   },
   "componentProperties": {
+    "autoDiscoverClient": { "kind": "property", "displayName": "Auto Discover Client", "group": "common", "label": "common", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "secret": false, "defaultValue": "true", "configurationClass": "org.apache.camel.component.aws.msk.MSKConfiguration", "configurationField": "configuration", "description": "Setting the autoDiscoverClient mechanism, if true, the component will look for a client instance in the registry [...]
     "accessKey": { "kind": "property", "displayName": "Access Key", "group": "producer", "label": "producer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": true, "configurationClass": "org.apache.camel.component.aws.msk.MSKConfiguration", "configurationField": "configuration", "description": "Amazon AWS Access Key" },
     "configuration": { "kind": "property", "displayName": "Configuration", "group": "producer", "label": "", "required": false, "type": "object", "javaType": "org.apache.camel.component.aws.msk.MSKConfiguration", "deprecated": 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, "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 starting and cause the r [...]
@@ -35,6 +36,7 @@
   },
   "properties": {
     "label": { "kind": "path", "displayName": "Label", "group": "producer", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "secret": false, "configurationClass": "org.apache.camel.component.aws.msk.MSKConfiguration", "configurationField": "configuration", "description": "Logical name" },
+    "autoDiscoverClient": { "kind": "parameter", "displayName": "Auto Discover Client", "group": "common", "label": "common", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "secret": false, "defaultValue": "true", "configurationClass": "org.apache.camel.component.aws.msk.MSKConfiguration", "configurationField": "configuration", "description": "Setting the autoDiscoverClient mechanism, if true, the component will look for a client instance in the registr [...]
     "accessKey": { "kind": "parameter", "displayName": "Access Key", "group": "producer", "label": "producer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": true, "configurationClass": "org.apache.camel.component.aws.msk.MSKConfiguration", "configurationField": "configuration", "description": "Amazon AWS Access Key" },
     "lazyStartProducer": { "kind": "parameter", "displayName": "Lazy Start Producer", "group": "producer", "label": "producer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": 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 starting and cause the  [...]
     "mskClient": { "kind": "parameter", "displayName": "Msk Client", "group": "producer", "label": "producer", "required": false, "type": "object", "javaType": "com.amazonaws.services.kafka.AWSKafka", "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.aws.msk.MSKConfiguration", "configurationField": "configuration", "description": "To use a existing configured AWS MSK as client" },
diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/aws-msk-component.adoc b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/aws-msk-component.adoc
index 215cb62..9629a2b 100644
--- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/aws-msk-component.adoc
+++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/aws-msk-component.adoc
@@ -36,13 +36,14 @@ You can append query options to the URI in the following format,
 
 
 // component options: START
-The AWS Managed Streaming for Apache Kafka (MSK) component supports 11 options, which are listed below.
+The AWS Managed Streaming for Apache Kafka (MSK) component supports 12 options, which are listed below.
 
 
 
 [width="100%",cols="2,5,^1,2",options="header"]
 |===
 | Name | Description | Default | Type
+| *autoDiscoverClient* (common) | Setting the autoDiscoverClient mechanism, if true, the component will look for a client instance in the registry automatically otherwise it will skip that checking. | true | boolean
 | *accessKey* (producer) | Amazon AWS Access Key |  | String
 | *configuration* (producer) | The component configuration |  | MSKConfiguration
 | *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 [...]
@@ -79,12 +80,13 @@ with the following path and query parameters:
 |===
 
 
-=== Query Parameters (11 parameters):
+=== Query Parameters (12 parameters):
 
 
 [width="100%",cols="2,5,^1,2",options="header"]
 |===
 | Name | Description | Default | Type
+| *autoDiscoverClient* (common) | Setting the autoDiscoverClient mechanism, if true, the component will look for a client instance in the registry automatically otherwise it will skip that checking. | true | boolean
 | *accessKey* (producer) | Amazon AWS Access Key |  | String
 | *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 [...]
 | *mskClient* (producer) | To use a existing configured AWS MSK as client |  | AWSKafka


[camel] 04/06: CAMEL-15310 - AWS* - Support for more than 1 client in the registry - Camel-AWS2-MSK

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 9c4a443cb0844ad1eb2648d37822848da4101055
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Fri Jul 24 14:10:03 2020 +0200

    CAMEL-15310 - AWS* - Support for more than 1 client in the registry - Camel-AWS2-MSK
---
 .../aws2/msk/MSK2ComponentConfigurer.java          |  5 ++++
 .../component/aws2/msk/MSK2EndpointConfigurer.java |  5 ++++
 .../apache/camel/component/aws2/msk/aws2-msk.json  |  2 ++
 .../src/main/docs/aws2-msk-component.adoc          |  6 +++--
 .../camel/component/aws2/msk/MSK2Component.java    |  4 ++-
 .../component/aws2/msk/MSK2Configuration.java      | 16 ++++++++++++
 .../aws2/msk/MSKComponentClientRegistryTest.java   | 24 ++++++++++++++++++
 .../dsl/Aws2MskComponentBuilderFactory.java        | 16 ++++++++++++
 .../builder/endpoint/StaticEndpointBuilders.java   |  8 +++---
 .../endpoint/dsl/MSK2EndpointBuilderFactory.java   | 29 ++++++++++++++++++++++
 10 files changed, 108 insertions(+), 7 deletions(-)

diff --git a/components/camel-aws2-msk/src/generated/java/org/apache/camel/component/aws2/msk/MSK2ComponentConfigurer.java b/components/camel-aws2-msk/src/generated/java/org/apache/camel/component/aws2/msk/MSK2ComponentConfigurer.java
index 7eff302..697bd09 100644
--- a/components/camel-aws2-msk/src/generated/java/org/apache/camel/component/aws2/msk/MSK2ComponentConfigurer.java
+++ b/components/camel-aws2-msk/src/generated/java/org/apache/camel/component/aws2/msk/MSK2ComponentConfigurer.java
@@ -28,6 +28,8 @@ public class MSK2ComponentConfigurer extends PropertyConfigurerSupport implement
         switch (ignoreCase ? name.toLowerCase() : name) {
         case "accesskey":
         case "accessKey": getOrCreateConfiguration(target).setAccessKey(property(camelContext, java.lang.String.class, value)); return true;
+        case "autodiscoverclient":
+        case "autoDiscoverClient": getOrCreateConfiguration(target).setAutoDiscoverClient(property(camelContext, boolean.class, value)); return true;
         case "basicpropertybinding":
         case "basicPropertyBinding": target.setBasicPropertyBinding(property(camelContext, boolean.class, value)); return true;
         case "configuration": target.setConfiguration(property(camelContext, org.apache.camel.component.aws2.msk.MSK2Configuration.class, value)); return true;
@@ -57,6 +59,7 @@ public class MSK2ComponentConfigurer extends PropertyConfigurerSupport implement
     public Map<String, Object> getAllOptions(Object target) {
         Map<String, Object> answer = new CaseInsensitiveMap();
         answer.put("accessKey", java.lang.String.class);
+        answer.put("autoDiscoverClient", boolean.class);
         answer.put("basicPropertyBinding", boolean.class);
         answer.put("configuration", org.apache.camel.component.aws2.msk.MSK2Configuration.class);
         answer.put("lazyStartProducer", boolean.class);
@@ -78,6 +81,8 @@ public class MSK2ComponentConfigurer extends PropertyConfigurerSupport implement
         switch (ignoreCase ? name.toLowerCase() : name) {
         case "accesskey":
         case "accessKey": return getOrCreateConfiguration(target).getAccessKey();
+        case "autodiscoverclient":
+        case "autoDiscoverClient": return getOrCreateConfiguration(target).isAutoDiscoverClient();
         case "basicpropertybinding":
         case "basicPropertyBinding": return target.isBasicPropertyBinding();
         case "configuration": return target.getConfiguration();
diff --git a/components/camel-aws2-msk/src/generated/java/org/apache/camel/component/aws2/msk/MSK2EndpointConfigurer.java b/components/camel-aws2-msk/src/generated/java/org/apache/camel/component/aws2/msk/MSK2EndpointConfigurer.java
index c92cc56..e783ee4 100644
--- a/components/camel-aws2-msk/src/generated/java/org/apache/camel/component/aws2/msk/MSK2EndpointConfigurer.java
+++ b/components/camel-aws2-msk/src/generated/java/org/apache/camel/component/aws2/msk/MSK2EndpointConfigurer.java
@@ -21,6 +21,8 @@ public class MSK2EndpointConfigurer extends PropertyConfigurerSupport implements
         switch (ignoreCase ? name.toLowerCase() : name) {
         case "accesskey":
         case "accessKey": target.getConfiguration().setAccessKey(property(camelContext, java.lang.String.class, value)); return true;
+        case "autodiscoverclient":
+        case "autoDiscoverClient": target.getConfiguration().setAutoDiscoverClient(property(camelContext, boolean.class, value)); return true;
         case "basicpropertybinding":
         case "basicPropertyBinding": target.setBasicPropertyBinding(property(camelContext, boolean.class, value)); return true;
         case "lazystartproducer":
@@ -50,6 +52,7 @@ public class MSK2EndpointConfigurer extends PropertyConfigurerSupport implements
     public Map<String, Object> getAllOptions(Object target) {
         Map<String, Object> answer = new CaseInsensitiveMap();
         answer.put("accessKey", java.lang.String.class);
+        answer.put("autoDiscoverClient", boolean.class);
         answer.put("basicPropertyBinding", boolean.class);
         answer.put("lazyStartProducer", boolean.class);
         answer.put("mskClient", software.amazon.awssdk.services.kafka.KafkaClient.class);
@@ -71,6 +74,8 @@ public class MSK2EndpointConfigurer extends PropertyConfigurerSupport implements
         switch (ignoreCase ? name.toLowerCase() : name) {
         case "accesskey":
         case "accessKey": return target.getConfiguration().getAccessKey();
+        case "autodiscoverclient":
+        case "autoDiscoverClient": return target.getConfiguration().isAutoDiscoverClient();
         case "basicpropertybinding":
         case "basicPropertyBinding": return target.isBasicPropertyBinding();
         case "lazystartproducer":
diff --git a/components/camel-aws2-msk/src/generated/resources/org/apache/camel/component/aws2/msk/aws2-msk.json b/components/camel-aws2-msk/src/generated/resources/org/apache/camel/component/aws2/msk/aws2-msk.json
index 6fe6baf..c6ed6f9 100644
--- a/components/camel-aws2-msk/src/generated/resources/org/apache/camel/component/aws2/msk/aws2-msk.json
+++ b/components/camel-aws2-msk/src/generated/resources/org/apache/camel/component/aws2/msk/aws2-msk.json
@@ -21,6 +21,7 @@
     "lenientProperties": false
   },
   "componentProperties": {
+    "autoDiscoverClient": { "kind": "property", "displayName": "Auto Discover Client", "group": "common", "label": "common", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "secret": false, "defaultValue": "true", "configurationClass": "org.apache.camel.component.aws2.msk.MSK2Configuration", "configurationField": "configuration", "description": "Setting the autoDiscoverClient mechanism, if true, the component will look for a client instance in the regist [...]
     "configuration": { "kind": "property", "displayName": "Configuration", "group": "producer", "label": "", "required": false, "type": "object", "javaType": "org.apache.camel.component.aws2.msk.MSK2Configuration", "deprecated": 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, "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 starting and cause the r [...]
     "mskClient": { "kind": "property", "displayName": "Msk Client", "group": "producer", "label": "", "required": false, "type": "object", "javaType": "software.amazon.awssdk.services.kafka.KafkaClient", "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.msk.MSK2Configuration", "configurationField": "configuration", "description": "To use a existing configured AWS MSK as client" },
@@ -37,6 +38,7 @@
   },
   "properties": {
     "label": { "kind": "path", "displayName": "Label", "group": "producer", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "secret": false, "configurationClass": "org.apache.camel.component.aws2.msk.MSK2Configuration", "configurationField": "configuration", "description": "Logical name" },
+    "autoDiscoverClient": { "kind": "parameter", "displayName": "Auto Discover Client", "group": "common", "label": "common", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "secret": false, "defaultValue": "true", "configurationClass": "org.apache.camel.component.aws2.msk.MSK2Configuration", "configurationField": "configuration", "description": "Setting the autoDiscoverClient mechanism, if true, the component will look for a client instance in the regis [...]
     "lazyStartProducer": { "kind": "parameter", "displayName": "Lazy Start Producer", "group": "producer", "label": "producer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": 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 starting and cause the  [...]
     "mskClient": { "kind": "parameter", "displayName": "Msk Client", "group": "producer", "label": "", "required": false, "type": "object", "javaType": "software.amazon.awssdk.services.kafka.KafkaClient", "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.msk.MSK2Configuration", "configurationField": "configuration", "description": "To use a existing configured AWS MSK as client" },
     "operation": { "kind": "parameter", "displayName": "Operation", "group": "producer", "label": "", "required": true, "type": "object", "javaType": "org.apache.camel.component.aws2.msk.MSK2Operations", "enum": [ "listClusters", "createCluster", "deleteCluster", "describeCluster" ], "deprecated": false, "deprecationNote": "", "secret": false, "configurationClass": "org.apache.camel.component.aws2.msk.MSK2Configuration", "configurationField": "configuration", "description": "The operatio [...]
diff --git a/components/camel-aws2-msk/src/main/docs/aws2-msk-component.adoc b/components/camel-aws2-msk/src/main/docs/aws2-msk-component.adoc
index 7127708..42665df 100644
--- a/components/camel-aws2-msk/src/main/docs/aws2-msk-component.adoc
+++ b/components/camel-aws2-msk/src/main/docs/aws2-msk-component.adoc
@@ -41,13 +41,14 @@ You can append query options to the URI in the following format,
 
 
 // component options: START
-The AWS 2 Managed Streaming for Apache Kafka (MSK) component supports 13 options, which are listed below.
+The AWS 2 Managed Streaming for Apache Kafka (MSK) component supports 14 options, which are listed below.
 
 
 
 [width="100%",cols="2,5,^1,2",options="header"]
 |===
 | Name | Description | Default | Type
+| *autoDiscoverClient* (common) | Setting the autoDiscoverClient mechanism, if true, the component will look for a client instance in the registry automatically otherwise it will skip that checking. | true | boolean
 | *configuration* (producer) | Component configuration |  | MSK2Configuration
 | *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 [...]
 | *mskClient* (producer) | To use a existing configured AWS MSK as client |  | KafkaClient
@@ -86,12 +87,13 @@ with the following path and query parameters:
 |===
 
 
-=== Query Parameters (13 parameters):
+=== Query Parameters (14 parameters):
 
 
 [width="100%",cols="2,5,^1,2",options="header"]
 |===
 | Name | Description | Default | Type
+| *autoDiscoverClient* (common) | Setting the autoDiscoverClient mechanism, if true, the component will look for a client instance in the registry automatically otherwise it will skip that checking. | true | boolean
 | *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 [...]
 | *mskClient* (producer) | To use a existing configured AWS MSK as client |  | KafkaClient
 | *operation* (producer) | *Required* The operation to perform. The value can be one of: listClusters, createCluster, deleteCluster, describeCluster |  | MSK2Operations
diff --git a/components/camel-aws2-msk/src/main/java/org/apache/camel/component/aws2/msk/MSK2Component.java b/components/camel-aws2-msk/src/main/java/org/apache/camel/component/aws2/msk/MSK2Component.java
index 396ab59..69f1045 100644
--- a/components/camel-aws2-msk/src/main/java/org/apache/camel/component/aws2/msk/MSK2Component.java
+++ b/components/camel-aws2-msk/src/main/java/org/apache/camel/component/aws2/msk/MSK2Component.java
@@ -55,7 +55,9 @@ public class MSK2Component extends DefaultComponent {
         MSK2Configuration configuration = this.configuration != null ? this.configuration.copy() : new MSK2Configuration();
         MSK2Endpoint endpoint = new MSK2Endpoint(uri, this, configuration);
         setProperties(endpoint, parameters);
-        checkAndSetRegistryClient(configuration, endpoint);
+        if (endpoint.getConfiguration().isAutoDiscoverClient()) {
+            checkAndSetRegistryClient(configuration, endpoint);
+        }
         if (configuration.getMskClient() == null && (configuration.getAccessKey() == null || configuration.getSecretKey() == null)) {
             throw new IllegalArgumentException("Amazon msk client or accessKey and secretKey must be specified");
         }
diff --git a/components/camel-aws2-msk/src/main/java/org/apache/camel/component/aws2/msk/MSK2Configuration.java b/components/camel-aws2-msk/src/main/java/org/apache/camel/component/aws2/msk/MSK2Configuration.java
index 42944aa..8d34a01 100644
--- a/components/camel-aws2-msk/src/main/java/org/apache/camel/component/aws2/msk/MSK2Configuration.java
+++ b/components/camel-aws2-msk/src/main/java/org/apache/camel/component/aws2/msk/MSK2Configuration.java
@@ -51,6 +51,8 @@ public class MSK2Configuration implements Cloneable {
     private boolean pojoRequest;
     @UriParam(defaultValue = "false")
     private boolean trustAllCertificates;
+    @UriParam(label = "common", defaultValue = "true")
+    private boolean autoDiscoverClient = true;
 
     public KafkaClient getMskClient() {
         return mskClient;
@@ -163,6 +165,20 @@ public class MSK2Configuration implements Cloneable {
     public void setTrustAllCertificates(boolean trustAllCertificates) {
         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;
+    }
+
 
     // *************************************************
     //
diff --git a/components/camel-aws2-msk/src/test/java/org/apache/camel/component/aws2/msk/MSKComponentClientRegistryTest.java b/components/camel-aws2-msk/src/test/java/org/apache/camel/component/aws2/msk/MSKComponentClientRegistryTest.java
index fec11d3..2504caf 100644
--- a/components/camel-aws2-msk/src/test/java/org/apache/camel/component/aws2/msk/MSKComponentClientRegistryTest.java
+++ b/components/camel-aws2-msk/src/test/java/org/apache/camel/component/aws2/msk/MSKComponentClientRegistryTest.java
@@ -20,6 +20,8 @@ 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;
 
 public class MSKComponentClientRegistryTest extends CamelTestSupport {
@@ -43,4 +45,26 @@ public class MSKComponentClientRegistryTest extends CamelTestSupport {
             component.createEndpoint("aws2-msk://label");
         });
     }
+    
+    @Test
+    public void createEndpointWithAutoDiscoverClientFalse() throws Exception {
+
+        AmazonMSKClientMock awsMSKClient = new AmazonMSKClientMock();
+        context.getRegistry().bind("awsMskClient", awsMSKClient);
+        MSK2Component component = context.getComponent("aws2-msk", MSK2Component.class);
+        MSK2Endpoint endpoint = (MSK2Endpoint) component.createEndpoint("aws-msk://label?accessKey=xxx&secretKey=yyy&autoDiscoverClient=false");
+
+        assertNotSame(awsMSKClient, endpoint.getConfiguration().getMskClient());
+    }
+    
+    @Test
+    public void createEndpointWithAutoDiscoverClientTrue() throws Exception {
+
+        AmazonMSKClientMock awsMSKClient = new AmazonMSKClientMock();
+        context.getRegistry().bind("awsMskClient", awsMSKClient);
+        MSK2Component component = context.getComponent("aws2-msk", MSK2Component.class);
+        MSK2Endpoint endpoint = (MSK2Endpoint) component.createEndpoint("aws2-msk://label?accessKey=xxx&secretKey=yyy");
+
+        assertSame(awsMSKClient, endpoint.getConfiguration().getMskClient());
+    }
 }
diff --git a/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/Aws2MskComponentBuilderFactory.java b/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/Aws2MskComponentBuilderFactory.java
index d9bff6b..6a35da1 100644
--- a/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/Aws2MskComponentBuilderFactory.java
+++ b/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/Aws2MskComponentBuilderFactory.java
@@ -47,6 +47,21 @@ public interface Aws2MskComponentBuilderFactory {
      */
     interface Aws2MskComponentBuilder extends ComponentBuilder<MSK2Component> {
         /**
+         * 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 Aws2MskComponentBuilder autoDiscoverClient(
+                boolean autoDiscoverClient) {
+            doSetProperty("autoDiscoverClient", autoDiscoverClient);
+            return this;
+        }
+        /**
          * Component configuration.
          * 
          * The option is a:
@@ -243,6 +258,7 @@ public interface Aws2MskComponentBuilderFactory {
                 String name,
                 Object value) {
             switch (name) {
+            case "autoDiscoverClient": getOrCreateConfiguration((MSK2Component) component).setAutoDiscoverClient((boolean) value); return true;
             case "configuration": ((MSK2Component) component).setConfiguration((org.apache.camel.component.aws2.msk.MSK2Configuration) value); return true;
             case "lazyStartProducer": ((MSK2Component) component).setLazyStartProducer((boolean) value); return true;
             case "mskClient": getOrCreateConfiguration((MSK2Component) component).setMskClient((software.amazon.awssdk.services.kafka.KafkaClient) value); return true;
diff --git a/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/StaticEndpointBuilders.java b/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/StaticEndpointBuilders.java
index 90049fb..0c349fe 100644
--- a/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/StaticEndpointBuilders.java
+++ b/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/StaticEndpointBuilders.java
@@ -1375,7 +1375,7 @@ public class StaticEndpointBuilders {
      * 
      * @param path label
      */
-    public static org.apache.camel.builder.endpoint.dsl.MSK2EndpointBuilderFactory.MSK2EndpointBuilder aws2Msk(
+    static org.apache.camel.builder.endpoint.dsl.MSK2EndpointBuilderFactory.MSK2EndpointBuilder aws2Msk(
             String path) {
         return org.apache.camel.builder.endpoint.dsl.MSK2EndpointBuilderFactory.endpointBuilder("aws2-msk", path);
     }
@@ -1396,7 +1396,7 @@ public class StaticEndpointBuilders {
      * instead of the default name
      * @param path label
      */
-    public static org.apache.camel.builder.endpoint.dsl.MSK2EndpointBuilderFactory.MSK2EndpointBuilder aws2Msk(
+    static org.apache.camel.builder.endpoint.dsl.MSK2EndpointBuilderFactory.MSK2EndpointBuilder aws2Msk(
             String componentName,
             String path) {
         return org.apache.camel.builder.endpoint.dsl.MSK2EndpointBuilderFactory.endpointBuilder(componentName, path);
@@ -2119,7 +2119,7 @@ public class StaticEndpointBuilders {
      * 
      * @param path label
      */
-    static org.apache.camel.builder.endpoint.dsl.MSKEndpointBuilderFactory.MSKEndpointBuilder awsMsk(
+    public static org.apache.camel.builder.endpoint.dsl.MSKEndpointBuilderFactory.MSKEndpointBuilder awsMsk(
             String path) {
         return org.apache.camel.builder.endpoint.dsl.MSKEndpointBuilderFactory.endpointBuilder("aws-msk", path);
     }
@@ -2140,7 +2140,7 @@ public class StaticEndpointBuilders {
      * instead of the default name
      * @param path label
      */
-    static org.apache.camel.builder.endpoint.dsl.MSKEndpointBuilderFactory.MSKEndpointBuilder awsMsk(
+    public static org.apache.camel.builder.endpoint.dsl.MSKEndpointBuilderFactory.MSKEndpointBuilder awsMsk(
             String componentName,
             String path) {
         return org.apache.camel.builder.endpoint.dsl.MSKEndpointBuilderFactory.endpointBuilder(componentName, path);
diff --git a/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/MSK2EndpointBuilderFactory.java b/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/MSK2EndpointBuilderFactory.java
index a4f4253..690e00d 100644
--- a/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/MSK2EndpointBuilderFactory.java
+++ b/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/MSK2EndpointBuilderFactory.java
@@ -39,6 +39,35 @@ public interface MSK2EndpointBuilderFactory {
             return (AdvancedMSK2EndpointBuilder) 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 MSK2EndpointBuilder 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 MSK2EndpointBuilder 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


[camel] 05/06: Regen website docs

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 205181484357c337725143ecd818734352e6547a
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Fri Jul 24 14:10:34 2020 +0200

    Regen website docs
---
 docs/components/modules/ROOT/pages/aws2-msk-component.adoc | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/docs/components/modules/ROOT/pages/aws2-msk-component.adoc b/docs/components/modules/ROOT/pages/aws2-msk-component.adoc
index 9069916..485be0d 100644
--- a/docs/components/modules/ROOT/pages/aws2-msk-component.adoc
+++ b/docs/components/modules/ROOT/pages/aws2-msk-component.adoc
@@ -43,13 +43,14 @@ You can append query options to the URI in the following format,
 
 
 // component options: START
-The AWS 2 Managed Streaming for Apache Kafka (MSK) component supports 13 options, which are listed below.
+The AWS 2 Managed Streaming for Apache Kafka (MSK) component supports 14 options, which are listed below.
 
 
 
 [width="100%",cols="2,5,^1,2",options="header"]
 |===
 | Name | Description | Default | Type
+| *autoDiscoverClient* (common) | Setting the autoDiscoverClient mechanism, if true, the component will look for a client instance in the registry automatically otherwise it will skip that checking. | true | boolean
 | *configuration* (producer) | Component configuration |  | MSK2Configuration
 | *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 [...]
 | *mskClient* (producer) | To use a existing configured AWS MSK as client |  | KafkaClient
@@ -88,12 +89,13 @@ with the following path and query parameters:
 |===
 
 
-=== Query Parameters (13 parameters):
+=== Query Parameters (14 parameters):
 
 
 [width="100%",cols="2,5,^1,2",options="header"]
 |===
 | Name | Description | Default | Type
+| *autoDiscoverClient* (common) | Setting the autoDiscoverClient mechanism, if true, the component will look for a client instance in the registry automatically otherwise it will skip that checking. | true | boolean
 | *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 [...]
 | *mskClient* (producer) | To use a existing configured AWS MSK as client |  | KafkaClient
 | *operation* (producer) | *Required* The operation to perform. The value can be one of: listClusters, createCluster, deleteCluster, describeCluster |  | MSK2Operations


[camel] 06/06: 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 d6b8f60cb5e2263d1f01d3f861df1721e3f2a3f1
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Fri Jul 24 14:11:21 2020 +0200

    Regen catalog
---
 .../resources/org/apache/camel/catalog/components/aws2-msk.json     | 2 ++
 .../resources/org/apache/camel/catalog/docs/aws2-msk-component.adoc | 6 ++++--
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/aws2-msk.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/aws2-msk.json
index 6fe6baf..c6ed6f9 100644
--- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/aws2-msk.json
+++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/aws2-msk.json
@@ -21,6 +21,7 @@
     "lenientProperties": false
   },
   "componentProperties": {
+    "autoDiscoverClient": { "kind": "property", "displayName": "Auto Discover Client", "group": "common", "label": "common", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "secret": false, "defaultValue": "true", "configurationClass": "org.apache.camel.component.aws2.msk.MSK2Configuration", "configurationField": "configuration", "description": "Setting the autoDiscoverClient mechanism, if true, the component will look for a client instance in the regist [...]
     "configuration": { "kind": "property", "displayName": "Configuration", "group": "producer", "label": "", "required": false, "type": "object", "javaType": "org.apache.camel.component.aws2.msk.MSK2Configuration", "deprecated": 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, "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 starting and cause the r [...]
     "mskClient": { "kind": "property", "displayName": "Msk Client", "group": "producer", "label": "", "required": false, "type": "object", "javaType": "software.amazon.awssdk.services.kafka.KafkaClient", "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.msk.MSK2Configuration", "configurationField": "configuration", "description": "To use a existing configured AWS MSK as client" },
@@ -37,6 +38,7 @@
   },
   "properties": {
     "label": { "kind": "path", "displayName": "Label", "group": "producer", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "secret": false, "configurationClass": "org.apache.camel.component.aws2.msk.MSK2Configuration", "configurationField": "configuration", "description": "Logical name" },
+    "autoDiscoverClient": { "kind": "parameter", "displayName": "Auto Discover Client", "group": "common", "label": "common", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "secret": false, "defaultValue": "true", "configurationClass": "org.apache.camel.component.aws2.msk.MSK2Configuration", "configurationField": "configuration", "description": "Setting the autoDiscoverClient mechanism, if true, the component will look for a client instance in the regis [...]
     "lazyStartProducer": { "kind": "parameter", "displayName": "Lazy Start Producer", "group": "producer", "label": "producer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": 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 starting and cause the  [...]
     "mskClient": { "kind": "parameter", "displayName": "Msk Client", "group": "producer", "label": "", "required": false, "type": "object", "javaType": "software.amazon.awssdk.services.kafka.KafkaClient", "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.msk.MSK2Configuration", "configurationField": "configuration", "description": "To use a existing configured AWS MSK as client" },
     "operation": { "kind": "parameter", "displayName": "Operation", "group": "producer", "label": "", "required": true, "type": "object", "javaType": "org.apache.camel.component.aws2.msk.MSK2Operations", "enum": [ "listClusters", "createCluster", "deleteCluster", "describeCluster" ], "deprecated": false, "deprecationNote": "", "secret": false, "configurationClass": "org.apache.camel.component.aws2.msk.MSK2Configuration", "configurationField": "configuration", "description": "The operatio [...]
diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/aws2-msk-component.adoc b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/aws2-msk-component.adoc
index 7127708..42665df 100644
--- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/aws2-msk-component.adoc
+++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/aws2-msk-component.adoc
@@ -41,13 +41,14 @@ You can append query options to the URI in the following format,
 
 
 // component options: START
-The AWS 2 Managed Streaming for Apache Kafka (MSK) component supports 13 options, which are listed below.
+The AWS 2 Managed Streaming for Apache Kafka (MSK) component supports 14 options, which are listed below.
 
 
 
 [width="100%",cols="2,5,^1,2",options="header"]
 |===
 | Name | Description | Default | Type
+| *autoDiscoverClient* (common) | Setting the autoDiscoverClient mechanism, if true, the component will look for a client instance in the registry automatically otherwise it will skip that checking. | true | boolean
 | *configuration* (producer) | Component configuration |  | MSK2Configuration
 | *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 [...]
 | *mskClient* (producer) | To use a existing configured AWS MSK as client |  | KafkaClient
@@ -86,12 +87,13 @@ with the following path and query parameters:
 |===
 
 
-=== Query Parameters (13 parameters):
+=== Query Parameters (14 parameters):
 
 
 [width="100%",cols="2,5,^1,2",options="header"]
 |===
 | Name | Description | Default | Type
+| *autoDiscoverClient* (common) | Setting the autoDiscoverClient mechanism, if true, the component will look for a client instance in the registry automatically otherwise it will skip that checking. | true | boolean
 | *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 [...]
 | *mskClient* (producer) | To use a existing configured AWS MSK as client |  | KafkaClient
 | *operation* (producer) | *Required* The operation to perform. The value can be one of: listClusters, createCluster, deleteCluster, describeCluster |  | MSK2Operations


[camel] 01/06: CAMEL-15310 - AWS* - Support for more than 1 client in the registry - Camel-AWS-MSK

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 23d32b71fa6e1e7fb3cf9d40b3341ac7273f1bf1
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Fri Jul 24 14:04:11 2020 +0200

    CAMEL-15310 - AWS* - Support for more than 1 client in the registry - Camel-AWS-MSK
---
 .../component/aws/msk/MSKComponentConfigurer.java  |  5 ++++
 .../component/aws/msk/MSKEndpointConfigurer.java   |  5 ++++
 .../apache/camel/component/aws/msk/aws-msk.json    |  2 ++
 .../src/main/docs/aws-msk-component.adoc           |  6 +++--
 .../camel/component/aws/msk/MSKComponent.java      |  4 +++-
 .../camel/component/aws/msk/MSKConfiguration.java  | 15 ++++++++++++
 .../aws/msk/MSKComponentClientRegistryTest.java    | 24 +++++++++++++++++++
 .../dsl/AwsMskComponentBuilderFactory.java         | 16 +++++++++++++
 .../builder/endpoint/StaticEndpointBuilders.java   |  8 +++----
 .../endpoint/dsl/MSKEndpointBuilderFactory.java    | 28 ++++++++++++++++++++++
 10 files changed, 106 insertions(+), 7 deletions(-)

diff --git a/components/camel-aws-msk/src/generated/java/org/apache/camel/component/aws/msk/MSKComponentConfigurer.java b/components/camel-aws-msk/src/generated/java/org/apache/camel/component/aws/msk/MSKComponentConfigurer.java
index 458bece..8f72d66 100644
--- a/components/camel-aws-msk/src/generated/java/org/apache/camel/component/aws/msk/MSKComponentConfigurer.java
+++ b/components/camel-aws-msk/src/generated/java/org/apache/camel/component/aws/msk/MSKComponentConfigurer.java
@@ -28,6 +28,8 @@ public class MSKComponentConfigurer extends PropertyConfigurerSupport implements
         switch (ignoreCase ? name.toLowerCase() : name) {
         case "accesskey":
         case "accessKey": getOrCreateConfiguration(target).setAccessKey(property(camelContext, java.lang.String.class, value)); return true;
+        case "autodiscoverclient":
+        case "autoDiscoverClient": getOrCreateConfiguration(target).setAutoDiscoverClient(property(camelContext, boolean.class, value)); return true;
         case "basicpropertybinding":
         case "basicPropertyBinding": target.setBasicPropertyBinding(property(camelContext, boolean.class, value)); return true;
         case "configuration": target.setConfiguration(property(camelContext, org.apache.camel.component.aws.msk.MSKConfiguration.class, value)); return true;
@@ -53,6 +55,7 @@ public class MSKComponentConfigurer extends PropertyConfigurerSupport implements
     public Map<String, Object> getAllOptions(Object target) {
         Map<String, Object> answer = new CaseInsensitiveMap();
         answer.put("accessKey", java.lang.String.class);
+        answer.put("autoDiscoverClient", boolean.class);
         answer.put("basicPropertyBinding", boolean.class);
         answer.put("configuration", org.apache.camel.component.aws.msk.MSKConfiguration.class);
         answer.put("lazyStartProducer", boolean.class);
@@ -72,6 +75,8 @@ public class MSKComponentConfigurer extends PropertyConfigurerSupport implements
         switch (ignoreCase ? name.toLowerCase() : name) {
         case "accesskey":
         case "accessKey": return getOrCreateConfiguration(target).getAccessKey();
+        case "autodiscoverclient":
+        case "autoDiscoverClient": return getOrCreateConfiguration(target).isAutoDiscoverClient();
         case "basicpropertybinding":
         case "basicPropertyBinding": return target.isBasicPropertyBinding();
         case "configuration": return target.getConfiguration();
diff --git a/components/camel-aws-msk/src/generated/java/org/apache/camel/component/aws/msk/MSKEndpointConfigurer.java b/components/camel-aws-msk/src/generated/java/org/apache/camel/component/aws/msk/MSKEndpointConfigurer.java
index 023c584..fdd3f51 100644
--- a/components/camel-aws-msk/src/generated/java/org/apache/camel/component/aws/msk/MSKEndpointConfigurer.java
+++ b/components/camel-aws-msk/src/generated/java/org/apache/camel/component/aws/msk/MSKEndpointConfigurer.java
@@ -21,6 +21,8 @@ public class MSKEndpointConfigurer extends PropertyConfigurerSupport implements
         switch (ignoreCase ? name.toLowerCase() : name) {
         case "accesskey":
         case "accessKey": target.getConfiguration().setAccessKey(property(camelContext, java.lang.String.class, value)); return true;
+        case "autodiscoverclient":
+        case "autoDiscoverClient": target.getConfiguration().setAutoDiscoverClient(property(camelContext, boolean.class, value)); return true;
         case "basicpropertybinding":
         case "basicPropertyBinding": target.setBasicPropertyBinding(property(camelContext, boolean.class, value)); return true;
         case "lazystartproducer":
@@ -46,6 +48,7 @@ public class MSKEndpointConfigurer extends PropertyConfigurerSupport implements
     public Map<String, Object> getAllOptions(Object target) {
         Map<String, Object> answer = new CaseInsensitiveMap();
         answer.put("accessKey", java.lang.String.class);
+        answer.put("autoDiscoverClient", boolean.class);
         answer.put("basicPropertyBinding", boolean.class);
         answer.put("lazyStartProducer", boolean.class);
         answer.put("mskClient", com.amazonaws.services.kafka.AWSKafka.class);
@@ -65,6 +68,8 @@ public class MSKEndpointConfigurer extends PropertyConfigurerSupport implements
         switch (ignoreCase ? name.toLowerCase() : name) {
         case "accesskey":
         case "accessKey": return target.getConfiguration().getAccessKey();
+        case "autodiscoverclient":
+        case "autoDiscoverClient": return target.getConfiguration().isAutoDiscoverClient();
         case "basicpropertybinding":
         case "basicPropertyBinding": return target.isBasicPropertyBinding();
         case "lazystartproducer":
diff --git a/components/camel-aws-msk/src/generated/resources/org/apache/camel/component/aws/msk/aws-msk.json b/components/camel-aws-msk/src/generated/resources/org/apache/camel/component/aws/msk/aws-msk.json
index 81a8a22..03c1fca 100644
--- a/components/camel-aws-msk/src/generated/resources/org/apache/camel/component/aws/msk/aws-msk.json
+++ b/components/camel-aws-msk/src/generated/resources/org/apache/camel/component/aws/msk/aws-msk.json
@@ -21,6 +21,7 @@
     "lenientProperties": false
   },
   "componentProperties": {
+    "autoDiscoverClient": { "kind": "property", "displayName": "Auto Discover Client", "group": "common", "label": "common", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "secret": false, "defaultValue": "true", "configurationClass": "org.apache.camel.component.aws.msk.MSKConfiguration", "configurationField": "configuration", "description": "Setting the autoDiscoverClient mechanism, if true, the component will look for a client instance in the registry [...]
     "accessKey": { "kind": "property", "displayName": "Access Key", "group": "producer", "label": "producer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": true, "configurationClass": "org.apache.camel.component.aws.msk.MSKConfiguration", "configurationField": "configuration", "description": "Amazon AWS Access Key" },
     "configuration": { "kind": "property", "displayName": "Configuration", "group": "producer", "label": "", "required": false, "type": "object", "javaType": "org.apache.camel.component.aws.msk.MSKConfiguration", "deprecated": 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, "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 starting and cause the r [...]
@@ -35,6 +36,7 @@
   },
   "properties": {
     "label": { "kind": "path", "displayName": "Label", "group": "producer", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "secret": false, "configurationClass": "org.apache.camel.component.aws.msk.MSKConfiguration", "configurationField": "configuration", "description": "Logical name" },
+    "autoDiscoverClient": { "kind": "parameter", "displayName": "Auto Discover Client", "group": "common", "label": "common", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "secret": false, "defaultValue": "true", "configurationClass": "org.apache.camel.component.aws.msk.MSKConfiguration", "configurationField": "configuration", "description": "Setting the autoDiscoverClient mechanism, if true, the component will look for a client instance in the registr [...]
     "accessKey": { "kind": "parameter", "displayName": "Access Key", "group": "producer", "label": "producer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": true, "configurationClass": "org.apache.camel.component.aws.msk.MSKConfiguration", "configurationField": "configuration", "description": "Amazon AWS Access Key" },
     "lazyStartProducer": { "kind": "parameter", "displayName": "Lazy Start Producer", "group": "producer", "label": "producer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": 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 starting and cause the  [...]
     "mskClient": { "kind": "parameter", "displayName": "Msk Client", "group": "producer", "label": "producer", "required": false, "type": "object", "javaType": "com.amazonaws.services.kafka.AWSKafka", "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.aws.msk.MSKConfiguration", "configurationField": "configuration", "description": "To use a existing configured AWS MSK as client" },
diff --git a/components/camel-aws-msk/src/main/docs/aws-msk-component.adoc b/components/camel-aws-msk/src/main/docs/aws-msk-component.adoc
index 215cb62..9629a2b 100644
--- a/components/camel-aws-msk/src/main/docs/aws-msk-component.adoc
+++ b/components/camel-aws-msk/src/main/docs/aws-msk-component.adoc
@@ -36,13 +36,14 @@ You can append query options to the URI in the following format,
 
 
 // component options: START
-The AWS Managed Streaming for Apache Kafka (MSK) component supports 11 options, which are listed below.
+The AWS Managed Streaming for Apache Kafka (MSK) component supports 12 options, which are listed below.
 
 
 
 [width="100%",cols="2,5,^1,2",options="header"]
 |===
 | Name | Description | Default | Type
+| *autoDiscoverClient* (common) | Setting the autoDiscoverClient mechanism, if true, the component will look for a client instance in the registry automatically otherwise it will skip that checking. | true | boolean
 | *accessKey* (producer) | Amazon AWS Access Key |  | String
 | *configuration* (producer) | The component configuration |  | MSKConfiguration
 | *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 [...]
@@ -79,12 +80,13 @@ with the following path and query parameters:
 |===
 
 
-=== Query Parameters (11 parameters):
+=== Query Parameters (12 parameters):
 
 
 [width="100%",cols="2,5,^1,2",options="header"]
 |===
 | Name | Description | Default | Type
+| *autoDiscoverClient* (common) | Setting the autoDiscoverClient mechanism, if true, the component will look for a client instance in the registry automatically otherwise it will skip that checking. | true | boolean
 | *accessKey* (producer) | Amazon AWS Access Key |  | String
 | *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 [...]
 | *mskClient* (producer) | To use a existing configured AWS MSK as client |  | AWSKafka
diff --git a/components/camel-aws-msk/src/main/java/org/apache/camel/component/aws/msk/MSKComponent.java b/components/camel-aws-msk/src/main/java/org/apache/camel/component/aws/msk/MSKComponent.java
index 09afbdc..4f258d0 100644
--- a/components/camel-aws-msk/src/main/java/org/apache/camel/component/aws/msk/MSKComponent.java
+++ b/components/camel-aws-msk/src/main/java/org/apache/camel/component/aws/msk/MSKComponent.java
@@ -50,7 +50,9 @@ public class MSKComponent extends DefaultComponent {
         MSKConfiguration configuration = this.configuration != null ? this.configuration.copy() : new MSKConfiguration();
         MSKEndpoint endpoint = new MSKEndpoint(uri, this, configuration);
         setProperties(endpoint, parameters);
-        checkAndSetRegistryClient(configuration);
+        if (endpoint.getConfiguration().isAutoDiscoverClient()) {
+            checkAndSetRegistryClient(configuration);
+        }
         if (configuration.getMskClient() == null && (configuration.getAccessKey() == null || configuration.getSecretKey() == null)) {
             throw new IllegalArgumentException("Amazon msk client or accessKey and secretKey must be specified");
         }
diff --git a/components/camel-aws-msk/src/main/java/org/apache/camel/component/aws/msk/MSKConfiguration.java b/components/camel-aws-msk/src/main/java/org/apache/camel/component/aws/msk/MSKConfiguration.java
index a862034..1e00742 100644
--- a/components/camel-aws-msk/src/main/java/org/apache/camel/component/aws/msk/MSKConfiguration.java
+++ b/components/camel-aws-msk/src/main/java/org/apache/camel/component/aws/msk/MSKConfiguration.java
@@ -47,6 +47,8 @@ public class MSKConfiguration implements Cloneable {
     private Integer proxyPort;
     @UriParam
     private String region;
+    @UriParam(label = "common", defaultValue = "true")
+    private boolean autoDiscoverClient = true;
 
     public AWSKafka getMskClient() {
         return mskClient;
@@ -136,6 +138,19 @@ public class MSKConfiguration implements Cloneable {
     public void setRegion(String region) {
         this.region = region;
     }
+    
+    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;
+    }
 
     // *************************************************
     //
diff --git a/components/camel-aws-msk/src/test/java/org/apache/camel/component/aws/msk/MSKComponentClientRegistryTest.java b/components/camel-aws-msk/src/test/java/org/apache/camel/component/aws/msk/MSKComponentClientRegistryTest.java
index 22bfa8e..d65119f 100644
--- a/components/camel-aws-msk/src/test/java/org/apache/camel/component/aws/msk/MSKComponentClientRegistryTest.java
+++ b/components/camel-aws-msk/src/test/java/org/apache/camel/component/aws/msk/MSKComponentClientRegistryTest.java
@@ -20,6 +20,8 @@ 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;
 
 public class MSKComponentClientRegistryTest extends CamelTestSupport {
@@ -42,4 +44,26 @@ public class MSKComponentClientRegistryTest extends CamelTestSupport {
         assertThrows(IllegalArgumentException.class,
             () -> component.createEndpoint("aws-msk://label"));
     }
+    
+    @Test
+    public void createEndpointWithAutoDiscoverClientFalse() throws Exception {
+
+        AmazonMSKClientMock awsMSKClient = new AmazonMSKClientMock();
+        context.getRegistry().bind("awsMskClient", awsMSKClient);
+        MSKComponent component = context.getComponent("aws-msk", MSKComponent.class);
+        MSKEndpoint endpoint = (MSKEndpoint) component.createEndpoint("aws-msk://label?accessKey=xxx&secretKey=yyy&autoDiscoverClient=false");
+
+        assertNotSame(awsMSKClient, endpoint.getConfiguration().getMskClient());
+    }
+    
+    @Test
+    public void createEndpointWithAutoDiscoverClientTrue() throws Exception {
+
+        AmazonMSKClientMock awsMSKClient = new AmazonMSKClientMock();
+        context.getRegistry().bind("awsMskClient", awsMSKClient);
+        MSKComponent component = context.getComponent("aws-msk", MSKComponent.class);
+        MSKEndpoint endpoint = (MSKEndpoint) component.createEndpoint("aws-msk://label?accessKey=xxx&secretKey=yyy");
+
+        assertSame(awsMSKClient, endpoint.getConfiguration().getMskClient());
+    }
 }
diff --git a/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/AwsMskComponentBuilderFactory.java b/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/AwsMskComponentBuilderFactory.java
index fc34a32..3c5b0f6 100644
--- a/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/AwsMskComponentBuilderFactory.java
+++ b/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/AwsMskComponentBuilderFactory.java
@@ -47,6 +47,21 @@ public interface AwsMskComponentBuilderFactory {
      */
     interface AwsMskComponentBuilder extends ComponentBuilder<MSKComponent> {
         /**
+         * 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 AwsMskComponentBuilder autoDiscoverClient(
+                boolean autoDiscoverClient) {
+            doSetProperty("autoDiscoverClient", autoDiscoverClient);
+            return this;
+        }
+        /**
          * Amazon AWS Access Key.
          * 
          * The option is a: <code>java.lang.String</code> type.
@@ -216,6 +231,7 @@ public interface AwsMskComponentBuilderFactory {
                 String name,
                 Object value) {
             switch (name) {
+            case "autoDiscoverClient": getOrCreateConfiguration((MSKComponent) component).setAutoDiscoverClient((boolean) value); return true;
             case "accessKey": getOrCreateConfiguration((MSKComponent) component).setAccessKey((java.lang.String) value); return true;
             case "configuration": ((MSKComponent) component).setConfiguration((org.apache.camel.component.aws.msk.MSKConfiguration) value); return true;
             case "lazyStartProducer": ((MSKComponent) component).setLazyStartProducer((boolean) value); return true;
diff --git a/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/StaticEndpointBuilders.java b/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/StaticEndpointBuilders.java
index 665d7fc..90049fb 100644
--- a/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/StaticEndpointBuilders.java
+++ b/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/StaticEndpointBuilders.java
@@ -1334,7 +1334,7 @@ public class StaticEndpointBuilders {
      * 
      * @param path label
      */
-    static org.apache.camel.builder.endpoint.dsl.MQ2EndpointBuilderFactory.MQ2EndpointBuilder aws2Mq(
+    public static org.apache.camel.builder.endpoint.dsl.MQ2EndpointBuilderFactory.MQ2EndpointBuilder aws2Mq(
             String path) {
         return org.apache.camel.builder.endpoint.dsl.MQ2EndpointBuilderFactory.endpointBuilder("aws2-mq", path);
     }
@@ -1355,7 +1355,7 @@ public class StaticEndpointBuilders {
      * instead of the default name
      * @param path label
      */
-    static org.apache.camel.builder.endpoint.dsl.MQ2EndpointBuilderFactory.MQ2EndpointBuilder aws2Mq(
+    public static org.apache.camel.builder.endpoint.dsl.MQ2EndpointBuilderFactory.MQ2EndpointBuilder aws2Mq(
             String componentName,
             String path) {
         return org.apache.camel.builder.endpoint.dsl.MQ2EndpointBuilderFactory.endpointBuilder(componentName, path);
@@ -2119,7 +2119,7 @@ public class StaticEndpointBuilders {
      * 
      * @param path label
      */
-    public static org.apache.camel.builder.endpoint.dsl.MSKEndpointBuilderFactory.MSKEndpointBuilder awsMsk(
+    static org.apache.camel.builder.endpoint.dsl.MSKEndpointBuilderFactory.MSKEndpointBuilder awsMsk(
             String path) {
         return org.apache.camel.builder.endpoint.dsl.MSKEndpointBuilderFactory.endpointBuilder("aws-msk", path);
     }
@@ -2140,7 +2140,7 @@ public class StaticEndpointBuilders {
      * instead of the default name
      * @param path label
      */
-    public static org.apache.camel.builder.endpoint.dsl.MSKEndpointBuilderFactory.MSKEndpointBuilder awsMsk(
+    static org.apache.camel.builder.endpoint.dsl.MSKEndpointBuilderFactory.MSKEndpointBuilder awsMsk(
             String componentName,
             String path) {
         return org.apache.camel.builder.endpoint.dsl.MSKEndpointBuilderFactory.endpointBuilder(componentName, path);
diff --git a/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/MSKEndpointBuilderFactory.java b/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/MSKEndpointBuilderFactory.java
index dfa1f13..ad4375b 100644
--- a/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/MSKEndpointBuilderFactory.java
+++ b/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/MSKEndpointBuilderFactory.java
@@ -39,6 +39,34 @@ public interface MSKEndpointBuilderFactory {
             return (AdvancedMSKEndpointBuilder) 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 MSKEndpointBuilder 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 MSKEndpointBuilder autoDiscoverClient(String autoDiscoverClient) {
+            doSetProperty("autoDiscoverClient", autoDiscoverClient);
+            return this;
+        }
+        /**
          * Amazon AWS Access Key.
          * 
          * The option is a: <code>java.lang.String</code> type.