feat: The position of the last seen messages is stored on a revoke
authorKai Moritz <kai@juplo.de>
Sun, 24 Sep 2023 19:42:22 +0000 (21:42 +0200)
committerKai Moritz <kai@juplo.de>
Tue, 20 Feb 2024 09:28:35 +0000 (10:28 +0100)
src/main/java/de/juplo/kafka/chat/backend/implementation/kafka/DataChannel.java

index c13f713..2c3e60a 100644 (file)
@@ -169,6 +169,7 @@ public class DataChannel implements Runnable, ConsumerRebalanceListener
     {
       int partition = topicPartition.partition();
       isShardOwned[partition] = false;
+      nextOffset[partition] = consumer.position(topicPartition);
       log.info("Partition revoked: {} - next={}", partition, nextOffset[partition]);
       infoChannel.sendShardRevokedEvent(partition);
     });