0

I have a unique situation where we have a kafka broker running since last 5 years. I have to spin up a new consumer but i know for sure that records/messages before 2023 are useless to me. Is there a way I can start reading records from Jan 1st 2023?

can the seek api help here?

  • Does this answer your question? [How to change start offset for topic?](https://stackoverflow.com/questions/29791268/how-to-change-start-offset-for-topic) – Chin Huang May 08 '23 at 16:28

1 Answers1

0

Yes, seek method after calling offsetsForTimes can help.

By default, non-compacted Kafka topics only hold data for 7 days, however.

OneCricketeer
  • 179,855
  • 19
  • 132
  • 245