[英]How to pick a group.id for my consumer group in an apache kafka cluster that is used by many other consumers?
We have been provided with a kafka cluster url for consuming messages, but we as the a consumer-side have multiple cluster nodes.我们已经提供了一个 kafka 集群 url 用于消费消息,但我们作为消费者端有多个集群节点。
For making sure that each message will be processed once only we are going to use a common group.id
shared by our consumer group.为了确保每条消息只被处理一次,我们将使用我们的消费者组共享的公共
group.id
。 Also we will Explicitly Commit Offsets.我们还将显式提交偏移量。
My question is: how do we make sure that we will not pick a group.id
that is already been used by other consumer groups?我的问题是:我们如何确保我们不会选择已经被其他消费者群体使用的
group.id
? Is there a naming convention followed that ensures group.id
uniqueness or should we contact the Kafka cluster maintainer for this?是否遵循命名约定来确保
group.id
的唯一性,或者我们是否应该为此联系 Kafka 集群维护者?
There are character restrictions (like no spaces or symbols other than [_.-]
group), but there is no general "convention" that is used outside of what your cluster maintainer might know.存在字符限制(例如除了
[_.-]
组之外没有空格或符号),但没有在集群维护者可能知道的范围之外使用的通用“约定”。
You can view all existing groups using您可以使用查看所有现有组
kafka-consumer-groups --list
Many companies get around this problem by generally setting an application's Kafka consumer group.id
to the application's name.许多公司通常通过将应用程序的 Kafka 消费者
group.id
设置为应用程序的名称来解决此问题。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.