The difference between groupid and consumerid in consumer Kafka

I am new to Kafka. I noticed that there are two identifiers in the Consumer configuration. one is group.id (required), and the second is consumer.id (optional). Please tell me why 2 identifiers and the difference.

+4
source share
1 answer

Consumer groups are a Kafka abstraction that allows you to support point-to-point and publish / subscribe messaging. A consumer can join a consumer group (say group_1) by setting it group.idto group_1. Consumer groups are also a way to support concurrent data consumption, that is, different consumers of the same consumer group consume data in parallel from different sections.

In addition to group.id, each consumer also identifies himself with a Kafka broker using consumer.id. This is used by Kafka to identify ACTIVE consumers in a specific consumer group.

Read this documentation for more details .

+7
source

Source: https://habr.com/ru/post/1622375/


All Articles