日志压缩主题不应该针对同一个键保留重复项。但在我们的例子中,当发送具有相同键的新值时,不会删除前一个值。可能是什么问题?
val TestCompactState: KTable[String, TestCompact] = builder.table[String, TestCompact](kafkaStreamConfigs.getString("testcompact-source"),
(TestCompactmaterialized).withKeySerde(stringSerde).withValueSerde(TestCompactSerde))
我得到的 实际结果
Offsets Keys Messages
5 {"id":5} {"id":5,"namee":"omer","__deleted":"false"}
6 {"id":5} {"id":5,"namee":"d","__deleted":"false"}
我只想要针对相同键预期结果的最新记录
6 {"id":5} {"id":5,"namee":"d","__deleted":"false"}