1

Is there any way to get the time when any consumer group last committed offsets? In other words, can we find out the timestamp of the last commit? If there is, does the Kafka Java library allow it to be obtained?

I have tried to find this out but haven't found anything satisfactory. The client Offset Explorer shows the timestamp for last commit by a consumer group. Does anyone have a clue how it manages to do so? And how similar clients could be working to fetch those details not available through programming apis.

vaibhavp
  • 43
  • 5
  • That tool shows the offset value of the consumer group, with the lag... I don't think it shows a timestamp of the last commit – OneCricketeer Mar 29 '22 at 16:45
  • It does show the last commit timestamp as well now. Added in version 2.0.7 @OneCricketeer – vaibhavp Mar 30 '22 at 10:07
  • Okay, well, maybe it reads data directly out of the offsets topic. Have you tried looking for a timestamp there? https://stackoverflow.com/questions/33925866/kafka-how-to-read-from-consumer-offsets-topic#38207110 – OneCricketeer Mar 30 '22 at 13:08
  • @OneCricketeer I have the same guess. Could not find any other way. Anyway, using https://www.codementor.io/@phanikumaryadavilli/parsing-apache-kafka-__consumer_offsets-using-kafka-command-and-java-api-1kb916n667 , i was able to consume committed offsets information. It had timestamp. – vaibhavp Mar 31 '22 at 07:15
  • That link is the same code logic from my link above – OneCricketeer Mar 31 '22 at 12:53
  • @OneCricketeer i understand. As of now, there is no other way offset timestamp can be obtained as per my understanding – vaibhavp Mar 31 '22 at 13:12

0 Answers0