InconsistentGroupProtocolException 在启动 Kafka 消费者时发生

huangapple go评论70阅读模式
英文:

InconsistentGroupProtocolException while bringing a Kafka consumer up

问题

我们有两个Spring Kafka应用程序,最近我们开始在其中一个应用程序的日志文件中观察到InconsistentGroupProtocolException
原来我们在每个应用程序中有两个消费者,它们都有相同的group.Id,即'consumer-common-grp',但订阅的主题不同,即应用程序1中的主题A和应用程序2中的主题B。

作为修复措施,我们在应用程序1中更改了消费者组的名称,这解决了我们的问题。但我的问题是,这之前是如何工作的?因为我们之前没有遇到这个问题,根据我的理解,Kafka认为组名称+主题是唯一的,而不仅仅是组名称。

英文:

We have 2 spring Kafka applications, recently we started observing InconsistentGroupProtocolException in one of our application logs file.
It turned out we have two consumers in each applications with same group.Id ‘consumer-common-grp’ but different topics i.e topic A in application 1 and topic B in application 2.

As a fix we changed the name of the consumer group in application 1 and it fixed our issue. But my question is how this was working before? As we didn’t face this issue before, and as per my understanding Kafka considers group name + topic for uniqueness not just group name.

答案1

得分: 0

Kafka不会“限制”消费者组...欢迎多个应用程序共享该字符串。当一个应用程序(重新)启动时,它将导致组内的所有成员重新平衡,以及完全停止消费者。是的,解决这个问题的方法是确保没有重叠(可以通过更好的证书策略和ACL来访问任何主题来实现)。

至于“不一致的协议”,您可以确保您的应用程序使用相同的kafka-clients依赖版本和分配策略

英文:

Kafka doesn't "fence" consumer groups... More than one app is more than welcome to share the string. When one (re)starts, it'll cause all in the group to rebalance, as well as full consumer stops. Yes, the fix to this is to ensure there is no overlap (can be accomplished by better certicate policies and ACLs to access any topic).

As far as "inconsistent protocol", you may ensure your apps are using the same kafka-clients dependency version and assignment strategies

huangapple
  • 本文由 发表于 2023年8月4日 05:05:05
  • 转载请务必保留本文链接:https://go.coder-hub.com/76831594.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定