Skip to content

Commit 5ad3f5c

Browse files
authored
Do not wait for a full batch if there's no messages in the topic (#77)
1 parent 4ed5f2d commit 5ad3f5c

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

kafka-ui-api/src/main/java/com/provectus/kafka/ui/cluster/service/ConsumingService.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,9 @@ public void emit(FluxSink<ConsumerRecord<Bytes, Bytes>> sink) {
107107
while (!sink.isCancelled() && ++pollsCount < MAX_POLLS_COUNT) {
108108
ConsumerRecords<Bytes, Bytes> records = consumer.poll(POLL_TIMEOUT_MS);
109109
log.info("{} records polled", records.count());
110+
if (records.count() == 0) {
111+
break;
112+
}
110113
records.iterator()
111114
.forEachRemaining(sink::next);
112115
}

0 commit comments

Comments
 (0)