bsm/sarama-cluster

offset for many partitions

adpoint opened this issue · 1 comments

i'am a newer, i read the example, but i have one question:
the API cluster.NewConfig() will set config.Consumer.Offsets.Initial, but the config.Consumer.Offsets.Initial is for group, not for partition? If i stop the consumer, then store the offsets that for all partitions, when i start consumer for next time, which offset can i set? Because there are many offsets for all partitions.

dim commented

sorry, that's not what the library is for. if you want to start from specific partition offsets, you could commit them to manually to kafka (not sure, but maybe kafka-consumer-groups.sh supports that) and then start your consumer group which will use the committed offsets (config.Consumer.Offsets.Initial is only used when no offsets are stored)