官术网_书友最值得收藏!

Message consumers

The consumer is any one who subscribes for topics in Kafka. Each consumer belongs to a consumer group and some consumer groups contains multiple consumers. Consumers are an interesting part of Kafka and we will cover them in detail.

Two consumers from the same group cannot consume message from a similar partition because it will lead to the message being consumed out of order. However, consumers from the same group can consume message from a different partition of the same topic simultaneously. Similarly, consumers from a different group can consume messages from the same partition in parallel without affecting the order of consumption.

So, it's clear that groups play an important role; in Kafka's initial version, Zookeeper was used for group management, but in the latest version, Kafka has its own group protocol built in. One of the brokers will act as a group coordinator and will be responsible for assigning and managing partitions for groups. We will talk about Zookeeper and its own protocol in later chapters specific to the consumer.

Remember that we talked about assigning an offset to a message in a partition; each consumer reads the offset and commits the offset to the group coordinator or Zookeeper. So if consumers fail for any reason, it will start from the next message of the committed offset.

Offset helps guarantee the processing of messages by consumers, which is important for most applications that cannot afford losing any message as part of their processing.
主站蜘蛛池模板: 西和县| 尚志市| 南丹县| 社旗县| 油尖旺区| 惠来县| 禄劝| 农安县| 来宾市| 祁东县| 西林县| 荃湾区| 会东县| 科技| 朔州市| 金乡县| 惠来县| 盱眙县| 额济纳旗| 巴林左旗| 涿州市| 黑河市| 庄河市| 焉耆| 彰武县| 常德市| 南丹县| 巴林右旗| 海晏县| 天峨县| 丹东市| 蓬溪县| 邹平县| 临潭县| 宣城市| 二手房| 崇义县| 德昌县| 海原县| 克东县| 义乌市|