1

Say my spring consumer program went down I want to consume data from the time it went down. Is there any way to store the timestamp or the offset at that point and continue from there.

Kindly help, Thanks in advance .

deon lobo
  • 23
  • 2
  • 1
    if you are committing the offset in your consumer, you dont need to maintain any offset. When you start your consumer again, it would start consuming from the point where it consumed last message successfully. – pratap May 26 '21 at 05:16

1 Answers1

1

Ensure 3 things:

  • group-id should be same between restarts
  • auto.offset.reset should be set as latest
  • offsets.retention.minutes should be well defined. Read THIS for more details for it.

Kafka-Docs for reference

Sahil Gupta
  • 2,028
  • 15
  • 22