Skip to content

Commit

Permalink
Do not wait for a full batch if there's no messages in the topic (#77)
Browse files Browse the repository at this point in the history
  • Loading branch information
apetrovs committed Jul 9, 2020
1 parent 4ed5f2d commit 5ad3f5c
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,9 @@ public void emit(FluxSink<ConsumerRecord<Bytes, Bytes>> sink) {
while (!sink.isCancelled() && ++pollsCount < MAX_POLLS_COUNT) {
ConsumerRecords<Bytes, Bytes> records = consumer.poll(POLL_TIMEOUT_MS);
log.info("{} records polled", records.count());
if (records.count() == 0) {
break;
}
records.iterator()
.forEachRemaining(sink::next);
}
Expand Down

0 comments on commit 5ad3f5c

Please sign in to comment.