There is no way to access this. In addition, before the Kafka messages v0.10do not contain any timestamp information, it is thus not possible to know when the message was recorded in the subject.
As with Kafka v0.10, each message contains a timestamp metadata attribute, which is either set by the manufacturer at the time the message was created, or by the broker when entering the input time. A temporary index is planned, but not yet available. Thus, you need to use the whole topic and check the timestamp field (and ignore all messages that you are not interested in). To find the beginning, you can also do a binary search for offsets and timestamps to find the first message faster.
Update:
Kakfa 0.10.1 . seek . KafkaConsumer#offsetsForTime(). , KafkaConsumer#seek(). ConsumerRecord#timestamp(), , .
, , . , "" , ( ).
- . , , , , ( "" ). . , " " , "" . " " , , .
- " ", , , "". , : (1) , ( - " ", , , ); (2) - , ( , "" , , ).
" " , , .