From b5a05c0ab78823534b787f00b9b8fda88a04e5c4 Mon Sep 17 00:00:00 2001 From: Christopher Catignani Date: Tue, 8 Dec 2015 00:41:16 -0800 Subject: [PATCH] fix to prevent empty messages from being posted --- src/main/java/com/uber/kafkaSpraynozzle/KafkaPoster.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/java/com/uber/kafkaSpraynozzle/KafkaPoster.java b/src/main/java/com/uber/kafkaSpraynozzle/KafkaPoster.java index d78234f..a807bc5 100644 --- a/src/main/java/com/uber/kafkaSpraynozzle/KafkaPoster.java +++ b/src/main/java/com/uber/kafkaSpraynozzle/KafkaPoster.java @@ -163,6 +163,10 @@ public void run() { } private boolean postBatchEvents(List batch) { + if (batch.isEmpty()) { + return true; + } + final long NANOS_PER_SECOND = 1000L * 1000L * 1000L; final long NANOS_PER_MILLI_SECOND = 1000L * 1000L; int pickedUrlIdx = currentUrl;