camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nferr...@apache.org
Subject [14/14] camel git commit: CAMEL-11331: Added better logging and upgrade library
Date Tue, 08 Aug 2017 14:43:32 GMT
CAMEL-11331: Added better logging and upgrade library


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/b0739238
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/b0739238
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/b0739238

Branch: refs/heads/master
Commit: b073923867c77f62b63d5c7337327c0720fe6105
Parents: b72cf4d
Author: Nicola Ferraro <ni.ferraro@gmail.com>
Authored: Tue Aug 1 10:30:26 2017 +0200
Committer: Nicola Ferraro <ni.ferraro@gmail.com>
Committed: Tue Aug 8 16:39:43 2017 +0200

----------------------------------------------------------------------
 components/camel-kubernetes/pom.xml             |  6 ++--
 .../kubernetes/ha/lock/TimedLeaderNotifier.java | 36 ++++++++++++--------
 2 files changed, 24 insertions(+), 18 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/b0739238/components/camel-kubernetes/pom.xml
----------------------------------------------------------------------
diff --git a/components/camel-kubernetes/pom.xml b/components/camel-kubernetes/pom.xml
index 38fa037..0d7b72b 100644
--- a/components/camel-kubernetes/pom.xml
+++ b/components/camel-kubernetes/pom.xml
@@ -44,14 +44,12 @@
     <dependency>
       <groupId>io.fabric8</groupId>
       <artifactId>kubernetes-client</artifactId>
-      <version>2.3-SNAPSHOT</version>
-      <!--<version>${kubernetes-client-version}</version>-->
+      <version>${kubernetes-client-version}</version>
     </dependency>
     <dependency>
       <groupId>io.fabric8</groupId>
       <artifactId>openshift-client</artifactId>
-      <version>2.3-SNAPSHOT</version>
-      <!--<version>${kubernetes-client-version}</version>-->
+      <version>${kubernetes-client-version}</version>
     </dependency>
     <!-- testing -->
     <dependency>

http://git-wip-us.apache.org/repos/asf/camel/blob/b0739238/components/camel-kubernetes/src/main/java/org/apache/camel/component/kubernetes/ha/lock/TimedLeaderNotifier.java
----------------------------------------------------------------------
diff --git a/components/camel-kubernetes/src/main/java/org/apache/camel/component/kubernetes/ha/lock/TimedLeaderNotifier.java
b/components/camel-kubernetes/src/main/java/org/apache/camel/component/kubernetes/ha/lock/TimedLeaderNotifier.java
index 6c51226..c95b517 100644
--- a/components/camel-kubernetes/src/main/java/org/apache/camel/component/kubernetes/ha/lock/TimedLeaderNotifier.java
+++ b/components/camel-kubernetes/src/main/java/org/apache/camel/component/kubernetes/ha/lock/TimedLeaderNotifier.java
@@ -155,25 +155,33 @@ public class TimedLeaderNotifier implements Service {
         final Optional<String> newLeader = leader;
         if (!newLeader.equals(lastCommunicatedLeader)) {
             lastCommunicatedLeader = newLeader;
-            LOG.debug("Communicating new leader: {}" + newLeader);
-            handler.onKubernetesClusterEvent(new KubernetesClusterEvent.KubernetesClusterLeaderChangedEvent()
{
-                @Override
-                public Optional<String> getData() {
-                    return newLeader;
-                }
-            });
+            LOG.info("The cluster has a new leader: {}", newLeader);
+            try {
+                handler.onKubernetesClusterEvent(new KubernetesClusterEvent.KubernetesClusterLeaderChangedEvent()
{
+                    @Override
+                    public Optional<String> getData() {
+                        return newLeader;
+                    }
+                });
+            } catch (Throwable t) {
+                LOG.warn("Error while communicating the new leader to the handler", t);
+            }
         }
 
         final Set<String> newMembers = members;
         if (!newMembers.equals(lastCommunicatedMembers)) {
             lastCommunicatedMembers = newMembers;
-            LOG.debug("Communicating new cluster members: {}" + newMembers);
-            handler.onKubernetesClusterEvent(new KubernetesClusterEvent.KubernetesClusterMemberListChangedEvent()
{
-                @Override
-                public Set<String> getData() {
-                    return newMembers;
-                }
-            });
+            LOG.info("The list of cluster members has changed: {}", newMembers);
+            try {
+                handler.onKubernetesClusterEvent(new KubernetesClusterEvent.KubernetesClusterMemberListChangedEvent()
{
+                    @Override
+                    public Set<String> getData() {
+                        return newMembers;
+                    }
+                });
+            } catch (Throwable t) {
+                LOG.warn("Error while communicating the cluster members to the handler",
t);
+            }
         }
 
     }


Mime
View raw message