summaryrefslogtreecommitdiffstats
path: root/engine-d
diff options
context:
space:
mode:
authortang peng <tang.peng5@zte.com.cn>2017-11-08 06:17:46 +0000
committerGerrit Code Review <gerrit@onap.org>2017-11-08 06:17:46 +0000
commit02913e9423547ceaeb05b94972c6908e16f2e1a5 (patch)
treef35f9d80a095910cfde9bc16a0390a665436289d /engine-d
parentaf1347f3aeb77096ef6a588ac4e6ed01300d64bc (diff)
parenta4e26fe5631174da6718dec2ee97be5e34e9f73e (diff)
Merge "Add Some Log Printing"
Diffstat (limited to 'engine-d')
-rw-r--r--engine-d/src/main/java/org/onap/holmes/engine/dmaap/DMaaPAlarmPolling.java4
-rw-r--r--engine-d/src/main/java/org/onap/holmes/engine/dmaap/SubscriberAction.java4
2 files changed, 7 insertions, 1 deletions
diff --git a/engine-d/src/main/java/org/onap/holmes/engine/dmaap/DMaaPAlarmPolling.java b/engine-d/src/main/java/org/onap/holmes/engine/dmaap/DMaaPAlarmPolling.java
index 37b39c0..47bd386 100644
--- a/engine-d/src/main/java/org/onap/holmes/engine/dmaap/DMaaPAlarmPolling.java
+++ b/engine-d/src/main/java/org/onap/holmes/engine/dmaap/DMaaPAlarmPolling.java
@@ -40,10 +40,12 @@ public class DMaaPAlarmPolling implements Runnable {
List<VesAlarm> vesAlarmList = new ArrayList<>();
try {
vesAlarmList = subscriber.subscribe();
+ vesAlarmList.forEach(vesAlarm -> droolsEngine.putRaisedIntoStream(vesAlarm));
} catch (CorrelationException e) {
log.error("Failed polling request alarm. " + e.getMessage());
+ } catch (Exception e) {
+ log.error("An error occurred while processing alarm.", e);
}
- vesAlarmList.forEach(vesAlarm -> droolsEngine.putRaisedIntoStream(vesAlarm));
}
}
diff --git a/engine-d/src/main/java/org/onap/holmes/engine/dmaap/SubscriberAction.java b/engine-d/src/main/java/org/onap/holmes/engine/dmaap/SubscriberAction.java
index 8d80a6b..12edc99 100644
--- a/engine-d/src/main/java/org/onap/holmes/engine/dmaap/SubscriberAction.java
+++ b/engine-d/src/main/java/org/onap/holmes/engine/dmaap/SubscriberAction.java
@@ -21,11 +21,13 @@ import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import javax.annotation.PreDestroy;
import javax.inject.Inject;
+import lombok.extern.slf4j.Slf4j;
import org.jvnet.hk2.annotations.Service;
import org.onap.holmes.dsa.dmaappolling.Subscriber;
import org.onap.holmes.engine.manager.DroolsEngine;
@Service
+@Slf4j
public class SubscriberAction {
@Inject
@@ -38,6 +40,7 @@ public class SubscriberAction {
Thread thread = new Thread(pollingTask);
thread.start();
pollingTasks.put(subscriber.getTopic(), pollingTask);
+ log.info("Subscribe to topic: " + subscriber.getUrl());
}
}
@@ -46,6 +49,7 @@ public class SubscriberAction {
pollingTasks.get(subscriber.getTopic()).stopTask();
pollingTasks.remove(subscriber.getTopic());
}
+ log.info("Topic unsubscribed: " + subscriber.getUrl());
}
@PreDestroy