camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject [04/10] camel git commit: CAMEL-9851: Fixed NPE in consumer if path is empty
Date Fri, 15 Apr 2016 06:54:10 GMT
CAMEL-9851: Fixed NPE in consumer if path is empty


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

Branch: refs/heads/camel-2.17.x
Commit: 5f3cb2eb1d8d9a3aa886a9a30b91ffb1887927da
Parents: dd45d21
Author: Claus Ibsen <davsclaus@apache.org>
Authored: Fri Apr 15 08:09:16 2016 +0200
Committer: Claus Ibsen <davsclaus@apache.org>
Committed: Fri Apr 15 08:52:05 2016 +0200

----------------------------------------------------------------------
 .../apache/camel/component/zookeeper/ZooKeeperConsumer.java  | 5 ++---
 .../camel/component/zookeeper/policy/ZooKeeperElection.java  | 8 +++-----
 2 files changed, 5 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/5f3cb2eb/components/camel-zookeeper/src/main/java/org/apache/camel/component/zookeeper/ZooKeeperConsumer.java
----------------------------------------------------------------------
diff --git a/components/camel-zookeeper/src/main/java/org/apache/camel/component/zookeeper/ZooKeeperConsumer.java
b/components/camel-zookeeper/src/main/java/org/apache/camel/component/zookeeper/ZooKeeperConsumer.java
index bb9507f..44b8f49 100644
--- a/components/camel-zookeeper/src/main/java/org/apache/camel/component/zookeeper/ZooKeeperConsumer.java
+++ b/components/camel-zookeeper/src/main/java/org/apache/camel/component/zookeeper/ZooKeeperConsumer.java
@@ -34,7 +34,6 @@ import org.apache.camel.impl.DefaultConsumer;
 import org.apache.zookeeper.WatchedEvent;
 import org.apache.zookeeper.ZooKeeper;
 
-
 /**
  * <code>ZooKeeperConsumer</code> uses various {@link ZooKeeperOperation} to
  * interact and consume data from a ZooKeeper cluster.
@@ -64,7 +63,7 @@ public class ZooKeeperConsumer extends DefaultConsumer {
         }
 
         initializeConsumer();
-        executor = getEndpoint().getCamelContext().getExecutorServiceManager().newFixedThreadPool(configuration.getPath(),
"Camel-Zookeeper Ops executor", 1);
+        executor = getEndpoint().getCamelContext().getExecutorServiceManager().newFixedThreadPool(this,
"Camel-Zookeeper OperationsExecutor", 1);
 
         OperationsExecutor opsService = new OperationsExecutor();
         executor.submit(opsService);
@@ -128,7 +127,6 @@ public class ZooKeeperConsumer extends DefaultConsumer {
 
         public void run() {
             while (isRunAllowed()) {
-
                 try {
                     current = operations.take();
                     if (log.isTraceEnabled()) {
@@ -169,6 +167,7 @@ public class ZooKeeperConsumer extends DefaultConsumer {
                     initializeConsumer();
                 }
             } catch (Exception e) {
+                // ignore
             }
         }
     }

http://git-wip-us.apache.org/repos/asf/camel/blob/5f3cb2eb/components/camel-zookeeper/src/main/java/org/apache/camel/component/zookeeper/policy/ZooKeeperElection.java
----------------------------------------------------------------------
diff --git a/components/camel-zookeeper/src/main/java/org/apache/camel/component/zookeeper/policy/ZooKeeperElection.java
b/components/camel-zookeeper/src/main/java/org/apache/camel/component/zookeeper/policy/ZooKeeperElection.java
index 79e6a19..cdff74c 100644
--- a/components/camel-zookeeper/src/main/java/org/apache/camel/component/zookeeper/policy/ZooKeeperElection.java
+++ b/components/camel-zookeeper/src/main/java/org/apache/camel/component/zookeeper/policy/ZooKeeperElection.java
@@ -146,15 +146,13 @@ public class ZooKeeperElection {
         producerTemplate.send(zep, e);
 
         if (e.isFailed()) {
-            LOG.error("Error setting up election node " + fullpath, e.getException());
+            LOG.warn("Error setting up election node " + fullpath, e.getException());
         } else {
             LOG.info("Candidate node '{}' has been created", fullpath);
             try {
-                if (zep != null) {
-                    camelContext.addRoutes(new ElectoralMonitorRoute(zep));
-                }
+                camelContext.addRoutes(new ElectoralMonitorRoute(zep));
             } catch (Exception ex) {
-                LOG.error("Error configuring ZookeeperElection", ex);
+                LOG.warn("Error configuring ZookeeperElection", ex);
             }
         }
         return zep;


Mime
View raw message