goapache-kafkakafka-consumer-apisarama

How to add consumerGroup for a topic in kafka using Shopify/sarama golang library?


In the sarama library there is an option to initialize NewConsumerGroup but how to hook it hook i t up to NewConumer?


Solution

  • NewConsumerGroup creates its own Consumer, so there's nothing for you to hook it to

    Source: https://github.com/Shopify/sarama/blob/main/consumer_group.go#L105