CCDAK · Question #209
Which two statements are correct when assigning partitions to the consumers in a consumer group using 'assign()' API? (Choose two.)
The correct answer is B. The consumer chooses which partition to read without any assignment from brokers. C. The consumer group will not be rebalanced if a consumer leaves the group. When using the assign() API, the consumer explicitly specifies which partitions to read from--no broker-driven assignment occurs. Since partition assignment is manual with assign(), the consumer group does not rebalance automatically when a consumer joins or leaves.
Question
Which two statements are correct when assigning partitions to the consumers in a consumer group using 'assign()' API? (Choose two.)
Options
- AIt is mandatory to subscribe to a topic before calling 'assign()' to assign partitions.
- BThe consumer chooses which partition to read without any assignment from brokers.
- CThe consumer group will not be rebalanced if a consumer leaves the group.
- DAll topics must have same number of partitions to use 'assign()' API.
How the community answered
(46 responses)- A17% (8)
- B76% (35)
- D7% (3)
Explanation
When using the assign() API, the consumer explicitly specifies which partitions to read from--no broker-driven assignment occurs. Since partition assignment is manual with assign(), the consumer group does not rebalance automatically when a consumer joins or leaves.
Topics
Community Discussion
No community discussion yet for this question.