- All Implemented Interfaces:
Embedded metadata timestamp was introduced in "KIP-32: Add timestamps to Kafka message" for the new 0.10+ Kafka message format.
Here, "embedded metadata" refers to the fact that compatible Kafka producer clients automatically and transparently embed such timestamps into message metadata they send to Kafka, which can then be retrieved via this timestamp extractor.
If the embedded metadata timestamp represents CreateTime (cf. Kafka broker setting
message.timestamp.type and Kafka topic setting
this extractor effectively provides event-time semantics.
If LogAppendTime is used as broker/topic setting to define the embedded metadata timestamps,
using this extractor effectively provides ingestion-time semantics.
If you need processing-time semantics, use
Method SummaryModifier and TypeMethodDescription
longReturns the current stream-time as new timestamp for the record.
onInvalidTimestamppublic long onInvalidTimestamp
(ConsumerRecord<Object, Object> record, long recordTimestamp, long partitionTime)throws StreamsExceptionReturns the current stream-time as new timestamp for the record.
record- a data record
recordTimestamp- the timestamp extractor from the record
partitionTime- the highest extracted valid timestamp of the current record's partition˙ (could be -1 if unknown)
- the provided highest extracted valid timestamp as new timestamp for the record
StreamsException- if highest extracted valid timestamp is unknown