CCDAK · Question #211
You need to explain the best reason to implement the consumer callback interface 'ConsumerRebalanceListener' prior to a Consumer Group Rebalance. Which statement is correct?
The correct answer is A. Partitions assigned to a consumer may change. The best reason to implement the ConsumerRebalanceListener is because partitions assigned to a consumer may change during a rebalance. This interface allows custom logic - such as committing offsets or initializing state - before and after partitions are reassigned.
Question
You need to explain the best reason to implement the consumer callback interface 'ConsumerRebalanceListener' prior to a Consumer Group Rebalance. Which statement is correct?
Options
- APartitions assigned to a consumer may change.
- BPrevious log files are deleted.
- COffsets are compacted.
- DPartition leaders may change.
How the community answered
(47 responses)- A89% (42)
- B2% (1)
- C2% (1)
- D6% (3)
Explanation
The best reason to implement the ConsumerRebalanceListener is because partitions assigned to a consumer may change during a rebalance. This interface allows custom logic - such as committing offsets or initializing state - before and after partitions are reassigned.
Topics
Community Discussion
No community discussion yet for this question.