From 9e9afccb7bb6f012314269ba0caf57ddc4e6dc1d Mon Sep 17 00:00:00 2001 From: Guangrong Fu Date: Thu, 9 Nov 2017 23:37:11 +0800 Subject: Fix Some Bugs Change-Id: Ie614f6ed325281fdc93644638e882541941e3690 Issue-ID: HOLMES-85 Signed-off-by: Guangrong Fu --- .../org/onap/holmes/engine/dmaap/DMaaPAlarmPolling.java | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'engine-d/src/main/java/org/onap') 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 141d89e..009de8e 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 @@ -15,6 +15,8 @@ */ package org.onap.holmes.engine.dmaap; +import static jdk.nashorn.internal.runtime.regexp.joni.Config.log; + import java.util.ArrayList; import java.util.List; import lombok.extern.slf4j.Slf4j; @@ -42,9 +44,19 @@ public class DMaaPAlarmPolling implements Runnable { vesAlarmList = subscriber.subscribe(); vesAlarmList.forEach(vesAlarm -> droolsEngine.putRaisedIntoStream(vesAlarm)); } catch (CorrelationException e) { - log.error("Failed to process alarms.", e); + log.error("Failed to process alarms. Sleep for 60 seconds to restart.", e); + try { + Thread.sleep(60000); + } catch (InterruptedException e1) { + log.info("Thread is still active.", e); + } } catch (Exception e) { - log.error("An error occurred while processing alarm.", e); + log.error("An error occurred while processing alarm. Sleep for 60 seconds to restart.", e); + try { + Thread.sleep(60000); + } catch (InterruptedException e1) { + log.info("Thread is still active.", e); + } } } } -- cgit 1.2.3-korg