Kafka consumer offset export golang — sharma or confluent-kafka-go lib


I am trying to find a way of performing offsets reset operation on consumer group which for example in Kafka commands would be something like this:

kafka-consumer-groups.sh --bootstrap-server $kfk --dry-run --reset-offsets --topic $t --group $cg1 --to-current --export | tee topic-offset.csv
kafka-consumer-groups.sh --bootstrap-server $kfk --dry-run --reset-offsets --topic $t --group $cg2 --to-current

and then import new offset base on that export file ?

kafka-consumer-groups.sh --bootstrap-server $kfk --execute --reset-offsets --topic $t --group $cg2 --from-file topic-offset.csv

The export import from file is not a problem … just seems cannot find way to get and then set the offset ..

so did anyone was playing with this using sharma or confluent-kafka-go lib ?

Thanks for any suggestions in advance 🙂


Here is some simple up which does the offset reset base on YMAL config


Command line tool for LAG monitoring consumer groups listing and offset reset.

Examples in README

Answered By – nonus25

Answer Checked By – Marie Seifert (GoLangFix Admin)

Leave a Reply

Your email address will not be published.