RangeAssignor is Kafka’s default consumer partition-assignment strategy. It orders consumers by memberId, then assigns each topic’s partitions sequentially in contiguous ranges. section 4.2.9
Its topic-by-topic assignment preserves partition-index alignment across topics when those topics have matching partition counts. Records sharing a key can therefore remain on the same consumer across related topics. section 4.2.9
Correlating invoices and profiles
An application consumes Invoices and Profiles and needs each customer’s records processed by one consumer instance. Sending both topics’ records with the customer identifier as the key routes corresponding records to the same partition index, allowing RangeAssignor to place them together. section 4.2.9
Choose RangeAssignor with these architectural consequences in mind:
- It supports co-partitioned processing across topics when partition counts and keying align. section 4.2.9
- It is an eager rebalance strategy, so all consumers pause while ownership is reassigned. section 4.2.7
- RoundRobinAssignor emphasizes even distribution, while StickyAssignor emphasizes retaining existing assignments during rebalancing. section 4.2.9
Figure 4.12 The RangeAssignor strategy
Use the assignment diagram to inspect how ordered consumers receive sequential partition ranges. section 4.2.9

