TransferConsumer logs the number of polled records only, when positive
authorKai Moritz <kai@juplo.de>
Fri, 18 Jun 2021 14:56:57 +0000 (16:56 +0200)
committerKai Moritz <kai@juplo.de>
Sat, 19 Jun 2021 16:02:03 +0000 (18:02 +0200)
src/main/java/de/juplo/kafka/payment/transfer/adapter/TransferConsumer.java

index 17d91de..e7c2430 100644 (file)
@@ -44,7 +44,8 @@ public class TransferConsumer implements Runnable
       try
       {
         ConsumerRecords<String, String> records = consumer.poll(Duration.ofSeconds(1));
-        log.debug("polled {} records", records.count());
+        if (records.count() > 0)
+          log.debug("polled {} records", records.count());
 
         records.forEach(record ->
         {