Reputation: 2048
This is a very basic question about Kafka and how messages are consumed but I was not able to find any answer on this point, unfortunately :'(.
Let's say I want to over partition a bit, so I would get 10 times more partitions than consumers. Over partition is required as I want to be able to scale (process more messages in parallel in the future).
1 topic divided in 1000 partitions consumed by 100 consumers =-> each consumer get assigned 10 partitions.
My questions are :
How messages are consumed for each consumer : is it done in a round-robin fashion ? If not, how is the distribution done ?
Is there any guarantee that the messages are going to be consumed evenly by the consumer between the 10 partitions they are assigned to ? Is there a risk that some partitions never get consumed ?
I was not able to find any answer on this point. And sorry if it's a duplicate !
Upvotes: 2
Views: 295
Reputation: 2286
The consumption of messages is done in a round robin way between the set of partitions assigned to a Consumer.
No, there is no guarantee that the messages are going to be consumed evenly between partitions. In the documentation for KIP-41 you can see an explanation on how this will work when you can specify the number of messages
Upvotes: 1