fix the code that determines when to publish batch 68/98868/2
authorsu622b <su622b@att.com>
Tue, 26 Nov 2019 20:31:44 +0000 (15:31 -0500)
committersunil unnava <su622b@att.com>
Tue, 26 Nov 2019 20:34:46 +0000 (20:34 +0000)
Issue-ID: DMAAP-1345
Change-Id: Ic297507a4faed4e109445f7a1fcb16435a1dc682
Signed-off-by: su622b <su622b@att.com>
src/main/java/org/onap/dmaap/mr/client/impl/MRSimplerBatchPublisher.java

index d9076a4..8f2a66e 100644 (file)
@@ -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);