kafka-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Matthias J. Sax" <matth...@confluent.io>
Subject Re: Record timestamp
Date Thu, 04 May 2017 22:17:48 GMT
The timestamp is always stored -- it's a metadata field that was added
to the message format in 0.10.0.

By default, Producer uses System.currentTimeMillis() to set the
timestamp before it send the record to the broker. Or you can explicitly
set the timestamp by yourself.

The default TimestampExtractor returns this metadata timestamp for each
record. This gives you event-time processing semantics. Thus, you
usually don't need to worry about this -- it's happens all out-of-box.

Furthermore in Streams, the timestamp will be set explicitly using
"stream time" (thus, Streams preserves event-time semantics). "stream
time" is an internally tracked timestamp, that aligns to the progress
during processing. I omit the details for now, but basically "stream
time" aligns with the record metadata timestamp of the currently
processed record.


-Matthias


On 5/4/17 12:02 PM, Murad Mamedov wrote:
> Hi,
> 
> In Producer record, we have timestamp.
> - Where it is actually stored, if stored?
> - When producing resorts with KStream.to() which timestamp is used, if used?
> 
> In order to guarantee proper timestamp, do we have to always implement
> timestamp extractor?
> 
> Thanks in advance.
> 


Mime
View raw message