From e279f0ec53147f53d7a48041c7b433b7738ae37d Mon Sep 17 00:00:00 2001 From: Jim Hahn Date: Wed, 11 Dec 2019 11:32:01 -0500 Subject: Fix timeout bug in dmaap simulator Also added a start script that can be used to execute the simulator in stand-alone mode (i.e., outside of a docker container). Change-Id: I26550ad36cfd2448c96cf0c09fec24e60ffd815b Issue-ID: POLICY-2298 Signed-off-by: Jim Hahn --- .../policy/models/sim/dmaap/provider/DmaapSimProvider.java | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'models-sim/models-sim-dmaap/src/main/java/org') diff --git a/models-sim/models-sim-dmaap/src/main/java/org/onap/policy/models/sim/dmaap/provider/DmaapSimProvider.java b/models-sim/models-sim-dmaap/src/main/java/org/onap/policy/models/sim/dmaap/provider/DmaapSimProvider.java index d11d1b397..c954ab8dc 100644 --- a/models-sim/models-sim-dmaap/src/main/java/org/onap/policy/models/sim/dmaap/provider/DmaapSimProvider.java +++ b/models-sim/models-sim-dmaap/src/main/java/org/onap/policy/models/sim/dmaap/provider/DmaapSimProvider.java @@ -129,15 +129,9 @@ public class DmaapSimProvider extends ServiceManagerContainer { List lst = topic2data.computeIfAbsent(topicName, this::makeTopicData).read(consumerGroup, limit, timeoutMs); - if (lst.isEmpty() && timeoutMs > 0) { - LOGGER.debug("Topic: {}, Timed out waiting for messages: {}: {}", topicName, consumerGroup, consumerId); - return Response.status(Status.REQUEST_TIMEOUT).entity(lst).build(); - - } else { - LOGGER.debug("Topic: {}, Retrieved {} messages for: {}: {}", topicName, consumerGroup, lst.size(), - consumerId); - return Response.status(Status.OK).entity(lst).build(); - } + LOGGER.debug("Topic: {}, Retrieved {} messages for: {}: {}", topicName, lst.size(), consumerGroup, + consumerId); + return Response.status(Status.OK).entity(lst).build(); } catch (InterruptedException e) { LOGGER.warn("Topic: {}, Request for DMaaP message interrupted: {}: {}", topicName, consumerGroup, -- cgit 1.2.3-korg