Confluent Kafka库是否允许在运行时间创建一个消费者组
我需要使用Kafka IADMinclient或任何其他将Kafka曝光的接口创建消费者组。 我了解,通过将true设置为允许。
就我而言,连接到活动中心。在事件中心,我们需要明确创建一个消费者组。如果在消耗消息时未指定消费者组,则使用$默认的消费者组。如果我提供事件中心中不存在的消费者组,则它会引发错误。
你们能把我带走正确的道路吗?
I have requirement to create consumer group at run time using Kafka IAdminClient or any other interfaces which Confluent Kafka exposes.
I understand that by setting true to allow.auto.create.topics will solve my requirement.
In my case am connecting to Event hub. In Event hub we need to explicitly create a consumer group. If no consumer group is specified while consuming the message it uses the $Default consumer group. If i provide the consumer group which does not exist in event hub then its throws an error.
Can you guys drive me in a right path?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
AdmInclient不负责创建群体。唯一的方法是通过
groupId
config将消费者订阅主题。如果您只想初始化一个空的组,请订阅消费者,将其从进行轮询时开始的偏移量,然后将其提交该组的偏移量。所有这些都是通过消费者实例完成的。
然后,您需要一个EventHub API客户端进行此操作,因为Kafka不在乎现有的组。如果不存在,将创建一个。
AdminClient isn't responsible for creation of groups. Only way to do that is subscribing consumers to topics with a
GroupId
config.If you just want to initialize an empty group, subscribe a consumer, seek it to the offset you'd like it to start from when it does poll, then commit that offset for the group. All of that is done via a Consumer instance.
Then you'd need an EventHub API client for this action, since Kafka doesn't care about existing groups; one will be created if it doesn't exist.