Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
由于我是 Go 和 kafka 的新手,我需要使用 confluent-kafka-go 模块来实现消费者组。谁能帮我吗?
提前致谢
使用confluent-kafka-go,您只需要group.id在您的消费者配置中进行设置,就可以让它加入/创建一个组。
confluent-kafka-go
group.id
例如:
c, err := kafka.NewConsumer(&kafka.ConfigMap{ "bootstrap.servers": "localhost:9092", "group.id": "my-group"})
其中一个示例表明:https ://github.com/confluentinc/confluent-kafka-go/blob/master/examples/consumer_example/consumer_example.go