Flink: Using the timestamp which are included inside the message for EventTime windowing

766 views Asked by At

I am taking the message from the Kafka streamer into Flink. The message have Record_time field included into it and I want to apply the time window based on the Record_time.

Can I extract or use the Record_time field to assign Timestamp to that message? As all the methods of interface TimestampExtractor are deprecated, is there any other way to do this?

1

There are 1 answers

2
Fabian Hueske On

TimestampExtractor has been deprecated and replaced by AssignerWithPeriodicWatermarks and AssignerWithPunctuatedWatermarks.

AssignerWithPeriodicWatermarks extracts timestamps for each record and is periodically queried for the current watermark.

´AssignerWithPunctuatedWatermarks` extracts timestamps for each record as well. In addition it is called for each record to extract a watermark. This is helpful if watermarks are encoded in special records.