Question 1
(Which configuration determines the maximum number of records a consumer can poll in a single call to poll()?)
- AOption A:
max.poll.records
- BOption B:
max.records.consumer
- COption C:
fetch.max.records
- DOption D:
max.poll.records.interval
Show answer and explanation
Correct answer: A
The Apache Kafka consumer configuration max.poll.records explicitly controls the maximum number of records returned in a single call to Consumer.poll(). This is clearly documented in the official Kafka consumer configuration reference. It allows developers to limit the size of the batch returned to the application, helping to control processing latency, memory usage, and CPU load.
This setting does not affect how much data the broker sends to the consumer; instead, it limits how many records the consumer returns to the application layer from the fetched data. This makes it especially useful for applications where processing each record is expensive and needs predictable batch sizes.
Option B (max.records.consumer) does not exist in Kafka. Option C (fetch.max.records) is also invalid; Kafka uses fetch.max.bytes and related byte-based configurations, not record-count limits, at the fetch level. Option D (max.poll.records.interval) is not a valid Kafka configuration; the correct related setting is max.poll.interval.ms, which controls liveness, not batch size.
Thus, max.poll.records is the correct and officially documented configuration.