Kafka reference

Consumer groups

Rules worth memorising

What triggers a rebalance

Configs

ConfigDefaultEffect
group.idnullNames the group. Required for subscribe() group management.
group.protocolclassicclassic or consumer. With consumer, the broker assigns partitions.
partition.assignment.strategyRangeAssignor, CooperativeStickyAssignorClient-side assignors, classic protocol only. Range is used by default.
group.remote.assignornullPicks a server-side assignor, such as uniform or range. Consumer protocol only.

Range assignor

Per topic: partitions in numeric order, consumers in sorted order, and any remainder goes to the first consumers. With 2 consumers and 2 topics of 3 partitions each, the split is 4 and 2.

Commands

kafka-consumer-groups.sh --bootstrap-server HOST:9092 --list
kafka-consumer-groups.sh --bootstrap-server HOST:9092 --describe --group G
kafka-consumer-groups.sh --bootstrap-server HOST:9092 --describe --group G --members --verbose

Related ideas