Closed ppilev closed 1 week ago
hey @LGouellec
I know the spare time is a luxury but could you please review it when you've got some. what's the chance to have that change being available with the upcoming 1.6.0 release?
regards, Plamen
Hi @ppilev ,
I will take a look before end of next week ! Good chance to merge before 1.6
Provides control over timestamp value of records published to Kafka output topic.
Some context below: Q: How this functionality is different than
ITimestampExtractor
applied to a source stream orIKStream<K, V>.WithRecordTimestamp
applied to some existing stream?A: In simple scenarios either method can be used to provide timestamps for the records sent to the output topic. For example
ITimestampExtractor
provides the initial value forRecordContext.Timestamp
, whereasIKStream<K, V>.WithRecordTimestamp
can override that value later. However in some scenarios you might need more grained control over what timestamp is applied to the output topic records and change that timestamp without affecting theRecordContext.Timestamp
of underlying stream.Example with pseudo code which WON'T WORK:
This basically will break your join because applying
joinedStream.WithRecordTimestamp(utcNow)
will override the timestamp inRecordContext.Timestamp
and value stored byKStreamJoinWindowProcessor
into thewindow
store will be utcNow as all topology processors are executed first:The solution I came up with is to bring the desired
timestamp
value directly toSinkProcessor
without touching the value inRecordContext.Timestamp
at all.Example with pseudo code which WORKS with changes proposed by this PR: