diff options
author | Jim Hahn <jrh3@att.com> | 2019-12-11 11:32:01 -0500 |
---|---|---|
committer | Jim Hahn <jrh3@att.com> | 2019-12-11 11:42:59 -0500 |
commit | e279f0ec53147f53d7a48041c7b433b7738ae37d (patch) | |
tree | c0356cfe3d753d2cc7ad4580c385a012df1386cb /models-sim/models-sim-dmaap/src/main/java | |
parent | f32f276bb5dddfc4d11be9f0c13227547a0110b1 (diff) |
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 <jrh3@att.com>
Diffstat (limited to 'models-sim/models-sim-dmaap/src/main/java')
-rw-r--r-- | models-sim/models-sim-dmaap/src/main/java/org/onap/policy/models/sim/dmaap/provider/DmaapSimProvider.java | 12 |
1 files changed, 3 insertions, 9 deletions
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<String> 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, |