Consuming Messages from a Kafka broker is a little bit more complex than in AMQP. You have already learned that a Kafka topic may consist of many partitions that each consumer can consume one or more (up to all) of these partitions. Kafka architectures allow horizontal scaling by dividing a topic into more partitions and having one consumer subscribe to each partition.
This means that each subscriber needs to know which partitions of a topic exist and which of those it should consume. Some of the libraries that we introduced earlier in this section (especially the Confluent library) actually support automatic subscriber partitioning and automatic group balancing. The sarama library does not offer this feature, ...