1

In Kafka for Spring, I see by default the max-poll-records value is 500. So my question is suppose if 500 messages are not present in the Topic will the consumer will wait to get 500 records then the poll method will run and fetch the batch of records.

I am a bit confused here like what are all the checks before pulling the message from Topic.

Learners
  • 121
  • 11
  • No, it limits the number of messages returned by one poll(). Probably this answer will help you https://stackoverflow.com/questions/51753883/increase-the-number-of-messages-read-by-a-kafka-consumer-in-a-single-poll – Stefan Lechner Jan 21 '22 at 10:43
  • 1
    It is not minimum poll records size, it is maximum so it will not block until 500 records fullfil. – shazin Jan 21 '22 at 10:45

1 Answers1

0

Kafka operates with hybrid strategies of polling. Usually, it is a combination of the number of records (or bytes) and time interval.

All the properties can be overridden to fit your expectations for consumption.

  • See `https://kafka.apache.org/documentation/#consumerconfigs_fetch.min.bytes` and https://kafka.apache.org/documentation/#consumerconfigs_fetch.max.wait.ms By default the poll will return as soon as any records (up to `max.poll.records` are available). – Gary Russell Jan 24 '22 at 14:27