kafka-go
kafka-go copied to clipboard
Partition rebalancing
ConsumerRebalance Listener methods implementations in kafka-go
Is there a way for me to flush and commit offsets on partitions revoked?
Additional questions (sorry I'm really new to this lib):
- Is it possible for us to set other configs? For example: enable.auto.commit to false?
You need to use the consumergroup API. See an example here:
https://github.com/segmentio/kafka-go/blob/master/example_consumergroup_test.go
@intouchkey Yes, @dmarkhas provided a good example of how to use consumer groups, and there is some additional documentation here on how it works as well https://pkg.go.dev/github.com/segmentio/kafka-go#ConsumerGroup
We don't have support for setting enable.auto.commit
but we do support similar functionality via explicit commits https://github.com/segmentio/kafka-go#explicit-commits
Let me know if this answers your questions!