mjsax commented on code in PR #21600:
URL: https://github.com/apache/kafka/pull/21600#discussion_r2887573169
##########
streams/src/main/java/org/apache/kafka/streams/kstream/internals/SessionCacheFlushListener.java:
##########
@@ -35,11 +38,17 @@ class SessionCacheFlushListener<KOut, VOut> implements
CacheFlushListener<Window
}
@Override
- public void apply(final Record<Windowed<KOut>, Change<VOut>> record) {
+ public void apply(final Record<Windowed<KOut>,
Change<AggregationWithHeaders<VOut>>> record) {
@SuppressWarnings("rawtypes") final ProcessorNode prev =
context.currentNode();
context.setCurrentNode(myNode);
try {
- context.forward(record.withTimestamp(record.key().window().end()));
+ final VOut newValue =
AggregationWithHeaders.getAggregationOrNull(record.value().newValue);
+ final VOut oldValue =
AggregationWithHeaders.getAggregationOrNull(record.value().oldValue);
+
+ context.forward(
+ record
+ .withValue(new Change<>(newValue, oldValue,
record.value().isLatest))
+ .withTimestamp(record.key().window().end()));
Review Comment:
We also need to set the header here.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]