Skip to content

Is it possible to use AutoOffsetReset: earliest and provide an offset or timestamp to reset to? #356

Answered by LGouellec
RossSteele asked this question in Q&A
Discussion options

You must be logged in to vote

Hey @RossSteele ,

Not by design directly in the application. The AutoOffsetReset policy is only used if your consumer group does not have a valid offset committed.

If you would like to reset the offset for a given consumer group and partition, you can use the Kafka CLI kafka-consumer-groups.sh to reset the offsets :
Example :

kafka-consumer-groups.sh --bootstrap-server localhost:9092 --group myConsumerGroup --reset-offsets --to-earliest --topic my_topic -execute

You can seek per offset or per timestamp or beginning or latest.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by LGouellec
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants