karaf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbono...@apache.org
Subject karaf-cellar git commit: Dealing with HazelcastInstanceNotActiveException in the QueueConsumer, close #9
Date Thu, 10 Dec 2015 17:28:01 GMT
Repository: karaf-cellar
Updated Branches:
  refs/heads/master 812d3fc15 -> c9b2c53d8


Dealing with HazelcastInstanceNotActiveException in the QueueConsumer, close #9


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

Branch: refs/heads/master
Commit: c9b2c53d86d1bbecae45a3d0e694435ee5d2a7fd
Parents: 812d3fc
Author: Jean-Baptiste Onofré <jbonofre@apache.org>
Authored: Thu Dec 10 18:27:22 2015 +0100
Committer: Jean-Baptiste Onofré <jbonofre@apache.org>
Committed: Thu Dec 10 18:27:22 2015 +0100

----------------------------------------------------------------------
 .../org/apache/karaf/cellar/hazelcast/QueueConsumer.java    | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/karaf-cellar/blob/c9b2c53d/hazelcast/src/main/java/org/apache/karaf/cellar/hazelcast/QueueConsumer.java
----------------------------------------------------------------------
diff --git a/hazelcast/src/main/java/org/apache/karaf/cellar/hazelcast/QueueConsumer.java
b/hazelcast/src/main/java/org/apache/karaf/cellar/hazelcast/QueueConsumer.java
index d19461d..d0e5ac1 100644
--- a/hazelcast/src/main/java/org/apache/karaf/cellar/hazelcast/QueueConsumer.java
+++ b/hazelcast/src/main/java/org/apache/karaf/cellar/hazelcast/QueueConsumer.java
@@ -13,10 +13,7 @@
  */
 package org.apache.karaf.cellar.hazelcast;
 
-import com.hazelcast.core.HazelcastInstance;
-import com.hazelcast.core.IQueue;
-import com.hazelcast.core.ItemEvent;
-import com.hazelcast.core.ItemListener;
+import com.hazelcast.core.*;
 import org.apache.karaf.cellar.core.Configurations;
 import org.apache.karaf.cellar.core.Dispatcher;
 import org.apache.karaf.cellar.core.Node;
@@ -105,10 +102,12 @@ public class QueueConsumer<E extends Event> implements EventConsumer<E>,
ItemLis
                 if (e != null) {
                     consume(e);
                 }
+            } catch (HazelcastInstanceNotActiveException hex) {
+                LOGGER.debug("CELLAR HAZELCAST: instance not active, stop consuming", hex);
+                break;
             } catch (Exception e1) {
                 LOGGER.error("CELLAR HAZELCAST: failed to consume from queue", e1);
             }
-
         }
         
         Thread.currentThread().setContextClassLoader(originalClassLoader);


Mime
View raw message