Consumer Poll Loop — Concept Check
Questions on Consumer Poll Loop. The consumer calls poll() in a loop to heartbeat with the coordinator and fetch records; max.poll.interval.ms must exceed the time to process a batch or the consumer is evicted.
Questions in this quiz
8 questions on Consumer Poll Loop — Concept Check. Work through them here, then start the quiz to answer them and see your score.
1.A Kafka consumer is experiencing frequent rebalances. Logs show each batch takes over 5 minutes to process. What should you do?
- ADecrease heartbeat.interval.ms
- BIncrease session.timeout.ms
- CDecrease max.poll.records
- DIncrease max.poll.interval.ms
2.During a Kafka consumer's operation, the poll() method is called but no records are returned. What does this indicate?
- AThe poll interval is set too low
- BThe consumer is not subscribed to any topics
- CNo records are available at the moment
- DThe consumer has been evicted
3.A consumer is evicted despite frequent heartbeat messages. What could be the cause?
- Asession.timeout.ms is too high
- Bmax.poll.interval.ms is too low
- CConsumer is not subscribed
- DHeartbeat interval is too short
4.What happens if poll() is not called within the max.poll.interval.ms period?
- AThe consumer increases poll interval
- BThe consumer fetches fewer records
- CThe consumer skips heartbeats
- DThe consumer is marked as dead
5.A developer sets max.poll.records to a very high number. What problem might this cause?
- AFaster processing of records
- BIncreased risk of consumer eviction
- CReduced poll interval
- DFewer heartbeats sent
6.Why is it important to set max.poll.interval.ms greater than batch processing time?
- ATo increase record throughput
- BTo reduce network latency
- CTo ensure frequent heartbeats
- DTo prevent consumer eviction
7.A consumer's poll() method blocks for the full duration specified. What does this imply?
- ANo records are immediately available
- BThe poll interval is too short
- CThe consumer is unsubscribed
- DThe consumer is evicted
8.What is the role of the poll() method in a Kafka consumer?
- AOnly send heartbeat
- BOnly fetch records
- CSend heartbeat and fetch records
- DCommit offsets synchronously