How to get Kafka timestamp for a record in Flink?
up vote
1
down vote
favorite
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?
java scala apache-kafka apache-flink kafka-consumer-api
add a comment |
up vote
1
down vote
favorite
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?
java scala apache-kafka apache-flink kafka-consumer-api
add a comment |
up vote
1
down vote
favorite
up vote
1
down vote
favorite
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?
java scala apache-kafka apache-flink kafka-consumer-api
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?
java scala apache-kafka apache-flink kafka-consumer-api
java scala apache-kafka apache-flink kafka-consumer-api
edited Nov 16 at 5:57
asked Nov 15 at 8:41
codeshark
1,84073873
1,84073873
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
up vote
1
down vote
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().
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
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().
add a comment |
up vote
1
down vote
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().
add a comment |
up vote
1
down vote
up vote
1
down vote
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().
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().
answered Nov 15 at 10:04
Axel Podehl
1,5191415
1,5191415
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53315359%2fhow-to-get-kafka-timestamp-for-a-record-in-flink%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown