Issue
The question seems to be very easy, but I haven't found an explanation on it. The default partition assignement strategy in kafka is with the RangeAssignor. How this assignor is working is explained as:
"The range assignor works on a per-topic basis. For each topic, we lay out the available partitions in numeric order and the consumers in lexicographic order. We then divide the number of partitions by the total number of consumers to determine the number of partitions to assign to each consumer. If it does not evenly divide, then the first few consumers will have one extra partition." https://kafka.apache.org/21/javadoc/org/apache/kafka/clients/consumer/RangeAssignor.html
How it works is clear so far. Unclear is on what attribute the lexicographic order is done. Is done by the id of a Consumer? Can anybody give an example for a lexicografic order of consumers?
Greetings,
maudeees
Solution
Since consumer client id is not required and group id should only be used for offset management, I assume it means by topic name, when the consumer is subscribed to multiple topics. If you are only using one topic, then only partitions are numerically ordered
Answered By - OneCricketeer Answer Checked By - Pedro (PHPFixing Volunteer)
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.