Kafka消费者中groupid和Consumerid之间的区别 [英] difference between groupid and consumerid in Kafka consumer

查看:9911
本文介绍了Kafka消费者中groupid和Consumerid之间的区别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我注意到消费者配置有两个ID.一个是group.id(强制性),第二个是consumer.id(非强制性).这2个ID之间有什么区别?

I noticed that the Consumer configuration has two IDs. one is group.id (mandatory) and second one is consumer.id (not Mandatory). What is the difference between these 2 IDs?

推荐答案

Consumers groups是Kafka的抽象,它支持点对点和发布/订阅消息传递.消费者可以通过将其group.id设置为group_1来加入消费者组(让我们说group_1).消费者组也是支持并行消费数据的一种方式,即同一消费者组的不同消费者从不同分区并行消费数据.

Consumers groups is a Kafka abstraction that enables supporting both point-to-point and publish/subscribe messaging. A consumer can join a consumer group (let us say group_1) by setting its group.id to group_1. Consumer groups is also a way of supporting parallel consumption of the data i.e. different consumers of the same consumer group consume data in parallel from different partitions.

除了group.id之外,每个使用者还使用consumer.id向Kafka经纪人标识自己. Kafka使用它来识别特定消费者组中当前处于活动状态的消费者.

In addition to group.id, each consumer also identifies itself to the Kafka broker using consumer.id. This is used by Kafka to identify the currently ACTIVE consumers of a particular consumer group.

有关详细信息,请阅读本文档.

Read this documentation for more details.

这篇关于Kafka消费者中groupid和Consumerid之间的区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆