From: Kai Moritz Date: Fri, 18 Jun 2021 14:56:57 +0000 (+0200) Subject: TransferConsumer logs the number of polled records only, when positive X-Git-Url: http://juplo.de/gitweb/?a=commitdiff_plain;h=78721edb87827a1837f298f24761af8be640c58b;p=demos%2Fkafka%2Fdemos-kafka-payment-system-transfer TransferConsumer logs the number of polled records only, when positive --- diff --git a/src/main/java/de/juplo/kafka/payment/transfer/adapter/TransferConsumer.java b/src/main/java/de/juplo/kafka/payment/transfer/adapter/TransferConsumer.java index 17d91de..e7c2430 100644 --- a/src/main/java/de/juplo/kafka/payment/transfer/adapter/TransferConsumer.java +++ b/src/main/java/de/juplo/kafka/payment/transfer/adapter/TransferConsumer.java @@ -44,7 +44,8 @@ public class TransferConsumer implements Runnable try { ConsumerRecords 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 -> {