Using assign() givesmanual controlover partition assignment. In this mode:
B is true: The applicationchooses partitionsdirectly without involving the group coordinator.
C is true: Since no group coordination occurs,no rebalancinghappens if a consumer dies.
FromKafka Consumer API Docs:
“assign() manually assigns a list of partitions to this consumer. No coordination takes place and no rebalancing is triggered.”
A is false: subscribe() and assign() aremutually exclusive.
D is incorrect: Partitions don't need to be equal across topics.
[Reference:Kafka Consumer Java API > assign() and subscribe(), ============]
Contribute your Thoughts:
Chosen Answer:
This is a voting comment (?). You can switch to a simple comment. It is better to Upvote an existing comment if you don't have anything to add.
Submit