From: Kai Moritz Date: Mon, 28 Oct 2024 09:49:26 +0000 (+0100) Subject: Log-Meldungen für das Senden des Zählerstands ergänzt X-Git-Tag: consumer/spring-consumer--log-compaction--2024-11-13--si~19 X-Git-Url: http://juplo.de/gitweb/?a=commitdiff_plain;h=0c76810199563e1a3abebec41121e4b57f1706e0;p=demos%2Fkafka%2Ftraining Log-Meldungen für das Senden des Zählerstands ergänzt --- diff --git a/src/main/java/de/juplo/kafka/ExampleConsumer.java b/src/main/java/de/juplo/kafka/ExampleConsumer.java index 2dfc2a4..8226f9f 100644 --- a/src/main/java/de/juplo/kafka/ExampleConsumer.java +++ b/src/main/java/de/juplo/kafka/ExampleConsumer.java @@ -231,12 +231,22 @@ public class ExampleConsumer implements Runnable, ConsumerRebalanceListener public void onPartitionsAssigned(Collection partitions) { phaser.bulkRegister(partitions.size()); + log.info( + "{} - Added {} parties for newly assigned partitions. New total number of parties: {}", + id, + partitions.size(), + phaser.getRegisteredParties()); } @Override public void onPartitionsRevoked(Collection partitions) { partitions.forEach(partition -> phaser.arriveAndDeregister()); + log.info( + "{} - Removed {} parties for revoked partitions. New total number of parties: {}", + id, + partitions.size(), + phaser.getRegisteredParties()); } public void shutdown() throws InterruptedException