Reputation: 5642
I have a Flink
application that uses the FlinkKafkaConsumer
.
I am interested in retrieving the Kafka
timestamp for a given record/offset
using the KeyedDeserializationSchema
. It seems that the topic, partition, offset, and message are available.
How can the timestamp be obtained?
Upvotes: 0
Views: 2629
Reputation: 4303
You can simply use ConsumerRecord.timestamp()
- the timestamp in milliseconds since beginning of the epoch (midnight Jan 1, 1970 (UTC)).
The timestamp type is indicated in timestampType().
Upvotes: 4