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 297d8705cb998a3053a57c7bdd039dba309c759d
Author: Andrea Cosentino <anco...@gmail.com>
AuthorDate: Tue Jul 21 08:32:36 2020 +0200

    CAMEL-15310 - AWS* - Support for more than 1 client in the registry - 
Camel-AWS-DDBStreams
---
 .../camel/component/aws/ddbstream/DdbStreamComponent.java     |  4 +++-
 .../camel/component/aws/ddbstream/DdbStreamConfiguration.java | 11 +++++++++++
 2 files changed, 14 insertions(+), 1 deletion(-)

diff --git 
a/components/camel-aws-ddb/src/main/java/org/apache/camel/component/aws/ddbstream/DdbStreamComponent.java
 
b/components/camel-aws-ddb/src/main/java/org/apache/camel/component/aws/ddbstream/DdbStreamComponent.java
index 46aedd1..99f882f 100644
--- 
a/components/camel-aws-ddb/src/main/java/org/apache/camel/component/aws/ddbstream/DdbStreamComponent.java
+++ 
b/components/camel-aws-ddb/src/main/java/org/apache/camel/component/aws/ddbstream/DdbStreamComponent.java
@@ -52,7 +52,9 @@ public class DdbStreamComponent extends DefaultComponent {
         configuration.setTableName(remaining);
         DdbStreamEndpoint endpoint = new DdbStreamEndpoint(uri, configuration, 
this);
         setProperties(endpoint, parameters);
-        checkAndSetRegistryClient(configuration);
+        if (endpoint.getConfiguration().isAutoDiscoverClient()) {
+            checkAndSetRegistryClient(configuration);
+        }
         if (configuration.getAmazonDynamoDbStreamsClient() == null && 
(configuration.getAccessKey() == null || configuration.getSecretKey() == null)) 
{
             throw new IllegalArgumentException("amazonDDBStreamsClient or 
accessKey and secretKey must be specified");
         }
diff --git 
a/components/camel-aws-ddb/src/main/java/org/apache/camel/component/aws/ddbstream/DdbStreamConfiguration.java
 
b/components/camel-aws-ddb/src/main/java/org/apache/camel/component/aws/ddbstream/DdbStreamConfiguration.java
index 92af2f0..b93f1ba 100644
--- 
a/components/camel-aws-ddb/src/main/java/org/apache/camel/component/aws/ddbstream/DdbStreamConfiguration.java
+++ 
b/components/camel-aws-ddb/src/main/java/org/apache/camel/component/aws/ddbstream/DdbStreamConfiguration.java
@@ -63,6 +63,9 @@ public class DdbStreamConfiguration implements Cloneable {
     private String proxyHost;
     @UriParam(description = "To define a proxy port when instantiating the 
DDBStreams client")
     private Integer proxyPort;
+    @UriParam(label = "common", defaultValue = "true", description = "Setting 
the autoDiscoverClient mechanism, if true, the component will "  
+               + " look for a client instance in the registry automatically 
otherwise it will skip that checking")
+    private boolean autoDiscoverClient = true;
     
     public AmazonDynamoDBStreams getAmazonDynamoDbStreamsClient() {
         return amazonDynamoDbStreamsClient;
@@ -152,6 +155,14 @@ public class DdbStreamConfiguration implements Cloneable {
         this.proxyPort = proxyPort;
     }
     
+    public boolean isAutoDiscoverClient() {
+        return autoDiscoverClient;
+    }
+
+    public void setAutoDiscoverClient(boolean autoDiscoverClient) {
+        this.autoDiscoverClient = autoDiscoverClient;
+    }
+    
     // *************************************************
     //
     // *************************************************

Reply via email to