@InterfaceStability.Evolving public interface TimestampExtractor
ConsumerRecord
.
The extracted timestamp is defined as milliseconds.Modifier and Type | Method and Description |
---|---|
long |
extract(ConsumerRecord<java.lang.Object,java.lang.Object> record,
long previousTimestamp)
Extracts a timestamp from a record.
|
long extract(ConsumerRecord<java.lang.Object,java.lang.Object> record, long previousTimestamp)
RuntimeException
instead of returning the timestamp is a valid option too.
For this case, Streams will stop processing and shut down to allow you investigate in the root cause of the
negative timestamp.
The timestamp extractor implementation must be stateless.
The extracted timestamp MUST represent the milliseconds since midnight, January 1, 1970 UTC.
It is important to note that this timestamp may become the message timestamp for any messages sent to changelogs
updated by KTable
s and joins.
The message timestamp is used for log retention and log rolling, so using nonsensical values may result in
excessive log rolling and therefore broker performance degradation.
record
- a data recordpreviousTimestamp
- the latest extracted valid timestamp of the current record's partition˙ (could be -1 if unknown)