hawkssss
hawkssss

Reputation: 11

behavior of kafka consumer poll method with one time call

Let's say I call poll() just once with some timeout, instead of while(true) {...poll...}

  1. Will the consumer get all the records from last committed to the latest available in one shot?
  2. Does the timeout parameter matters? E.g. if timeout==0 and there are millions of records, what happens?

Upvotes: 0

Views: 545

Answers (1)

Giorgos Myrianthous
Giorgos Myrianthous

Reputation: 39955

According to the kafka-doc, by default max.poll.records is 500

The maximum number of records returned in a single call to poll().

Therefore, every time you call poll() you can get upto 500 max.poll.records=500 from last committed offset

Upvotes: 1

Related Questions