Apache Kafka stores the message with offset. The following are several ways the messages can be retrieved with time;
...
Kafka Low Level Consumer API
For message partition reading, the kafka.api.OffsetRequest
class defines two constants: EarliestTime
and LatestTime
,
to find the beginning of the data in the logs and the new messages stream.