Hi Vishal May this doc[1] be helpful for you. [1] https://ci.apache.org/projects/flink/flink-docs-release-1.7/dev/connectors/kafka.html#kafka-consumers-and-timestamp-extractionwatermark-emission Best, Congxian
Vishal Santoshi <vishal.santo...@gmail.com> 于2019年1月30日周三 上午4:36写道: > It seems from > https://ci.apache.org/projects/flink/flink-docs-stable/dev/event_time.html > that iTimeCharacteristic.IngestionTime should do the trick. > > Just wanted to confirm that the ingestion time is the event time provided > by the kafka producer. > > On Tue, Jan 29, 2019 at 3:21 PM Vishal Santoshi <vishal.santo...@gmail.com> > wrote: > >> In case where one needs t to use kafka event time ( ingestion time ) >> for watermark generation and timestamp extraction is setting >> EventTimeCharactersitic as EventTime enough ? >> >> Or is this explicit code required ? >> >> consumer.assignTimestampsAndWatermarks(new >> AssignerWithPunctuatedWatermarks<KafkaRecord>() { >> @Nullable >> @Override >> public Watermark checkAndGetNextWatermark(KafkaRecord lastElement, long >> extractedTimestamp) { >> return new Watermark(extractedTimestamp); >> } >> >> @Override >> public long extractTimestamp(KafkaRecord element, long >> previousElementTimestamp) { >> return previousElementTimestamp; >> } >> }); >> >> >> >> >> >>