aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorsu622b <su622b@att.com>2019-11-26 15:31:44 -0500
committersunil unnava <su622b@att.com>2019-11-26 20:34:46 +0000
commit4e6f8ad82b553c3a0d727a186a615a6addf484a3 (patch)
tree83513adabcbb0e456e5b8ad1f705ddbf9312fb62 /src
parent050efb3743cc127f2f3a3298d6731dd926994cd2 (diff)
fix the code that determines when to publish batch
Issue-ID: DMAAP-1345 Change-Id: Ic297507a4faed4e109445f7a1fcb16435a1dc682 Signed-off-by: su622b <su622b@att.com>
Diffstat (limited to 'src')
-rw-r--r--src/main/java/org/onap/dmaap/mr/client/impl/MRSimplerBatchPublisher.java3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/main/java/org/onap/dmaap/mr/client/impl/MRSimplerBatchPublisher.java b/src/main/java/org/onap/dmaap/mr/client/impl/MRSimplerBatchPublisher.java
index d9076a4..8f2a66e 100644
--- a/src/main/java/org/onap/dmaap/mr/client/impl/MRSimplerBatchPublisher.java
+++ b/src/main/java/org/onap/dmaap/mr/client/impl/MRSimplerBatchPublisher.java
@@ -131,6 +131,7 @@ public class MRSimplerBatchPublisher extends MRBaseClient implements MRBatchingP
private String fTransportype;
private String fTopic;
private int fMaxBatchSize = 100;
+
private long fMaxBatchAgeMs = 1000;
private boolean fCompress = false;
private int threadOccuranceTime = 50;
@@ -233,7 +234,7 @@ public class MRSimplerBatchPublisher extends MRBaseClient implements MRBatchingP
private synchronized boolean shouldSendNow() {
boolean shouldSend = false;
- if (fPending.isEmpty()) {
+ if (fPending.size()>0) {
final long nowMs = Clock.now();
shouldSend = (fPending.size() >= fMaxBatchSize);