How to reset the offset in REST proxy for reconsuming Kafka messages?

1.3k views Asked by At

I consumed some messages from the Kafka queue, and now I want to consume them again (just fetch all data from the beginning). How can I reset the offset in Scala or using Kafka Rest Proxy? I am currently using "auto.offset.reset": "smallest":

curl -X POST -H "Content-Type: application/vnd.kafka.v1+json" \
      --data '{"format": "json", "auto.offset.reset": "smallest"}' \
      XXX.XX.XXX.XXX:9092/consumers/test

Please notice that I am not interested in the solution

1

There are 1 answers

0
Natalia On BEST ANSWER

The last param in the URL is group Id. Kafka stores committed offset per group Id. So, changing group Id should be enough (.../consumers/newGroupId).