0

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?

1 Answers1

0

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.

In Event hub we need to explicitly create a consumer group.

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.

OneCricketeer
  • 179,855
  • 19
  • 132
  • 245