使用 Stream DSL 在 Kafka Streams 中指定每个 stream/table 时间戳提取器

Specify per stream/table timestamp extractor in Kafka Streams using the Stream DSL

我想使用 Kafka Streams 加入两个不同的主题。这两个主题的数据格式不同,所以我想使用不同的时间戳提取器。我看到这个功能有一个合并的 pullrequest(KAFKA-4144), but I only find it 处理器 API。

Stream API 是否存在此功能?

StreamsBuilder#stream(...) 有一个带有 Consumed 参数的重载,允许您指定所有可选属性,如时间戳提取器。

https://docs.confluent.io/current/streams/javadocs/org/apache/kafka/streams/Consumed.html

一般来说,您可以在升级指南中找到 API 更改描述: