eagle-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ralp...@apache.org
Subject incubator-eagle git commit: EAGLE-641: Publishment reload may introduce NPE
Date Wed, 19 Oct 2016 10:11:02 GMT
Repository: incubator-eagle
Updated Branches:
  refs/heads/master c45ac6d57 -> 44259aeca


EAGLE-641: Publishment reload may introduce NPE

The publishment initialization may have problem which will cause reload NPE.

Author: Li, Garrett
Reviewer: ralphsu

This closes #534


Project: http://git-wip-us.apache.org/repos/asf/incubator-eagle/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-eagle/commit/44259aec
Tree: http://git-wip-us.apache.org/repos/asf/incubator-eagle/tree/44259aec
Diff: http://git-wip-us.apache.org/repos/asf/incubator-eagle/diff/44259aec

Branch: refs/heads/master
Commit: 44259aeca48554b9ee60d127cbc4d39649067943
Parents: c45ac6d
Author: Xiancheng Li <xiancheng.li@ebay.com>
Authored: Wed Oct 19 02:53:35 2016 -0700
Committer: Ralph, Su <suliangfei@gmail.com>
Committed: Wed Oct 19 18:02:06 2016 +0800

----------------------------------------------------------------------
 .../eagle/alert/engine/publisher/impl/AlertKafkaPublisher.java   | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/44259aec/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/main/java/org/apache/eagle/alert/engine/publisher/impl/AlertKafkaPublisher.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/main/java/org/apache/eagle/alert/engine/publisher/impl/AlertKafkaPublisher.java
b/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/main/java/org/apache/eagle/alert/engine/publisher/impl/AlertKafkaPublisher.java
index 5df34e3..e9c0c70 100644
--- a/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/main/java/org/apache/eagle/alert/engine/publisher/impl/AlertKafkaPublisher.java
+++ b/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/main/java/org/apache/eagle/alert/engine/publisher/impl/AlertKafkaPublisher.java
@@ -75,7 +75,9 @@ public class AlertKafkaPublisher extends AbstractPublishPlugin {
         String newBrokerList = pluginProperties.get(PublishConstants.BROKER_LIST).trim();
         String newTopic = pluginProperties.get(PublishConstants.TOPIC).trim();
         if (!newBrokerList.equals(this.brokerList)) {
-            producer.close();
+            if (producer != null) {
+                producer.close();
+            }
             brokerList = newBrokerList;
             KafkaProducer newProducer = null;
             try {


Mime
View raw message