From 718a1611a1e580ed7874088e1a0e013416334989 Mon Sep 17 00:00:00 2001 From: huaxing Date: Wed, 10 Jun 2020 14:58:34 +0800 Subject: Improve robustness of unit testing Issue-ID: POLICY-2630 Signed-off-by: huaxing Change-Id: I6475f9272c1a770836af537c13b23e486b66ac3e --- .../onap/policy/apex/service/engine/engdep/EngDepMessageListener.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'services/services-engine/src/main/java') diff --git a/services/services-engine/src/main/java/org/onap/policy/apex/service/engine/engdep/EngDepMessageListener.java b/services/services-engine/src/main/java/org/onap/policy/apex/service/engine/engdep/EngDepMessageListener.java index 2e8218a99..57c547b8c 100644 --- a/services/services-engine/src/main/java/org/onap/policy/apex/service/engine/engdep/EngDepMessageListener.java +++ b/services/services-engine/src/main/java/org/onap/policy/apex/service/engine/engdep/EngDepMessageListener.java @@ -77,7 +77,7 @@ public class EngDepMessageListener implements MessageListener, Runnable // The message listener thread and stopping flag private Thread messageListenerThread; - private boolean stopOrderedFlag = false; + private volatile boolean stopOrderedFlag = false; // The message queue is used to hold messages prior to forwarding to Apex private final BlockingQueue> messageQueue = new LinkedBlockingDeque<>(); @@ -149,7 +149,7 @@ public class EngDepMessageListener implements MessageListener, Runnable @Override public void run() { // Take messages off the queue and forward them to the Apex engine - while (messageListenerThread.isAlive() && !stopOrderedFlag) { + while (!stopOrderedFlag) { pollAndHandleMessage(); } } -- cgit 1.2.3-korg