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/03/12 10:05:38 UTC

[camel] branch master updated (3b82829 -> bcb4380)

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.


 discard 3b82829  Camel-AWS2-MSK: Fixed CS
     new 83d65f1  CAMEL-14690 - Camel-AWS2: Better logging when checking client instance in the registry, MSK
     new bcb4380  Camel-AWS2-MSK: Fixed CS

This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version.  This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:

 * -- * -- B -- O -- O -- O   (3b82829)
            \
             N -- N -- N   refs/heads/master (bcb4380)

You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.

Any revisions marked "omit" are not gone; other references still
refer to them.  Any revisions marked "discard" are gone forever.

The 2 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:
 .../main/java/org/apache/camel/component/aws2/msk/MSK2Component.java   | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)


[camel] 01/02: CAMEL-14690 - Camel-AWS2: Better logging when checking client instance in the registry, 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 83d65f1312fbc97462d8a8520f61d5ea9d89a5dc
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Thu Mar 12 11:03:04 2020 +0100

    CAMEL-14690 - Camel-AWS2: Better logging when checking client instance in the registry, MSK
---
 .../camel/component/aws2/msk/MSK2Component.java    | 26 +++++++++++++++++-----
 1 file changed, 20 insertions(+), 6 deletions(-)

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 ca92a4f..8a8dbba 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
@@ -24,6 +24,10 @@ 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.kafka.KafkaClient;
 
 /**
@@ -31,7 +35,9 @@ import software.amazon.awssdk.services.kafka.KafkaClient;
  */
 @Component("aws2-msk")
 public class MSK2Component extends DefaultComponent {
-
+	
+    private static final Logger LOG = LoggerFactory.getLogger(MSK2Component.class);
+    
     @Metadata
     private MSK2Configuration configuration = new MSK2Configuration();
 
@@ -50,7 +56,7 @@ 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);
+        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");
         }
@@ -68,10 +74,18 @@ public class MSK2Component extends DefaultComponent {
         this.configuration = configuration;
     }
 
-    private void checkAndSetRegistryClient(MSK2Configuration configuration) {
-        Set<KafkaClient> clients = getCamelContext().getRegistry().findByType(KafkaClient.class);
-        if (clients.size() == 1) {
-            configuration.setMskClient(clients.stream().findFirst().get());
+    private void checkAndSetRegistryClient(MSK2Configuration configuration, MSK2Endpoint endpoint) {
+        if (ObjectHelper.isEmpty(endpoint.getConfiguration().getMskClient())) {
+            LOG.debug("Looking for an KafkaClient instance in the registry");
+            Set<KafkaClient> clients = getCamelContext().getRegistry().findByType(KafkaClient.class);
+            if (clients.size() == 1) {
+                LOG.debug("Found exactly one KafkaClient instance in the registry");
+                configuration.setMskClient(clients.stream().findFirst().get());
+            } else {
+                LOG.debug("No KafkaClient instance in the registry");
+            }
+        } else {
+            LOG.debug("KafkaClient instance is already set at endpoint level: skipping the check in the registry");
         }
     }
 }


[camel] 02/02: Camel-AWS2-MSK: Fixed CS

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 bcb438060b5aef5b2e3cf752b19c5b4fe0506315
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Thu Mar 12 11:05:14 2020 +0100

    Camel-AWS2-MSK: Fixed CS
---
 .../main/java/org/apache/camel/component/aws2/msk/MSK2Component.java   | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

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 8a8dbba..396ab59 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
@@ -27,7 +27,6 @@ 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.kafka.KafkaClient;
 
 /**
@@ -35,7 +34,7 @@ import software.amazon.awssdk.services.kafka.KafkaClient;
  */
 @Component("aws2-msk")
 public class MSK2Component extends DefaultComponent {
-	
+
     private static final Logger LOG = LoggerFactory.getLogger(MSK2Component.class);
     
     @Metadata