From 771b5236c44e2d91ac997f9b3222e7e1729519fe Mon Sep 17 00:00:00 2001 From: Kai Moritz Date: Sun, 24 Mar 2024 09:51:45 +0100 Subject: [PATCH] fix: GREEN - Loading finishes, if info-topic is empty --- .../chat/backend/implementation/kafka/InfoChannel.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/de/juplo/kafka/chat/backend/implementation/kafka/InfoChannel.java b/src/main/java/de/juplo/kafka/chat/backend/implementation/kafka/InfoChannel.java index 95f7fb06..69f45321 100644 --- a/src/main/java/de/juplo/kafka/chat/backend/implementation/kafka/InfoChannel.java +++ b/src/main/java/de/juplo/kafka/chat/backend/implementation/kafka/InfoChannel.java @@ -204,8 +204,9 @@ public class InfoChannel implements Channel for (ConsumerRecord record : records) { handleMessage(record); - updateNextOffset(record.partition(), record.offset() + 1); + this.nextOffset[record.partition()] = record.offset() + 1; } + updateChannelState(); } catch (WakeupException e) { @@ -218,9 +219,8 @@ public class InfoChannel implements Channel log.info("Exiting normally"); } - private void updateNextOffset(int partition, long nextOffset) + private void updateChannelState() { - this.nextOffset[partition] = nextOffset; if (channelState == ChannelState.LOAD_IN_PROGRESS) { boolean loadInProgress = IntStream -- 2.39.5