Consumer Group in Kafka [Video Tutorials]: Partitions and Consumers
In this video tutorial series, take a deeper look at the consumer group in Kafka with varying numbers of partitions and consumers.
In this video tutorial series, take a deeper look at the consumer group in Kafka with:
- 1 partition and 2 consumers
- 2 partitions and 2 consumers
- 3 partitions and 1 consumer
Consumer Group in Kafka With 1 Partition and 2 Consumers
In this first Apache Kafka tutorial, learn about Java Kafka consumer code with 1 partition and 2 consumers.
- Both consumers are registered to the same consumer group.
- One consumer will be sitting idle.
- The same partition cannot be assigned to multiple consumers in the same group.
Let's begin!
Consumer Group in Kafka With 2 Partitions and 2 Consumers
The following tutorial explains the Kafka consumer group with 2 partitions and 2 consumers.
- Both consumers are registered to the same consumer group.
- The same partition cannot be assigned to multiple consumers in the same group.
Consumer Group in Kafka with 3 Partitions and 1 Consumer
Now let's learn about 3 partitions and 1 consumer within consumer groups in Apache Kafka.
- The message will be published to partition randomly.
- The message will be consumed by "consumer 1" in a round-robin.
- One consumer can consume messages from more than one partition.
Opinions expressed by DZone contributors are their own.