aboutsummaryrefslogtreecommitdiffstats
path: root/services/services-engine/src/main/java/org
diff options
context:
space:
mode:
authorhuaxing <huaxing.jin@est.tech>2020-06-10 14:58:34 +0800
committerhuaxing <huaxing.jin@est.tech>2020-06-12 09:59:42 +0800
commit718a1611a1e580ed7874088e1a0e013416334989 (patch)
tree605f35ec8940bb986deaf7b96a76b97709ba7b76 /services/services-engine/src/main/java/org
parent950622063ecc737ef7106ed9c380a077441b76aa (diff)
Improve robustness of unit testing
Issue-ID: POLICY-2630 Signed-off-by: huaxing <huaxing.jin@est.tech> Change-Id: I6475f9272c1a770836af537c13b23e486b66ac3e
Diffstat (limited to 'services/services-engine/src/main/java/org')
-rw-r--r--services/services-engine/src/main/java/org/onap/policy/apex/service/engine/engdep/EngDepMessageListener.java4
1 files changed, 2 insertions, 2 deletions
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<Message>, 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<MessageBlock<Message>> messageQueue = new LinkedBlockingDeque<>();
@@ -149,7 +149,7 @@ public class EngDepMessageListener implements MessageListener<Message>, Runnable
@Override
public void run() {
// Take messages off the queue and forward them to the Apex engine
- while (messageListenerThread.isAlive() && !stopOrderedFlag) {
+ while (!stopOrderedFlag) {
pollAndHandleMessage();
}
}