admin管理员组文章数量:1332339
I'm trying to debug a problem in our production Kafka Streams app. The (simplified) topology looks something like this
builder.stream("input").groupByKey().reduce(
(agg, val) -> "bar",
Materialized.as("saved_store")
);
99% of our incoming messages on the "input" topic seem to work fine, but I found some cases that didn't. I see a single message for a particular key 123
in "input"
"123": "foo"
but when I look at the private Kafka topic that "saved_store" is materializing to, there are two messages there and both of them look like
"123": "bar"
What could be causing this? I would expect the saved store to only have a single message AND for value to be "foo", since the reducer is not supposed to be called when the key is seen for the first time.
I'm trying to debug a problem in our production Kafka Streams app. The (simplified) topology looks something like this
builder.stream("input").groupByKey().reduce(
(agg, val) -> "bar",
Materialized.as("saved_store")
);
99% of our incoming messages on the "input" topic seem to work fine, but I found some cases that didn't. I see a single message for a particular key 123
in "input"
"123": "foo"
but when I look at the private Kafka topic that "saved_store" is materializing to, there are two messages there and both of them look like
"123": "bar"
What could be causing this? I would expect the saved store to only have a single message AND for value to be "foo", since the reducer is not supposed to be called when the key is seen for the first time.
Share Improve this question edited Nov 20, 2024 at 20:54 Rob 15.2k30 gold badges48 silver badges73 bronze badges asked Nov 20, 2024 at 20:32 EgorEgor 1,66013 silver badges26 bronze badges 1- Did you try disable caching to remove one moving piece? – Matthias J. Sax Commented Dec 29, 2024 at 18:11
1 Answer
Reset to default 0look at the private Kafka topic that "saved_store" is materializing to,
That's the wrong way to view a store. Compacted topics back stores. Compacted topics do not guarantee unique keys within an open segment, before a log cleaner thread runs
"Uncompacted' topics Vs compacted topics
本文标签: apache kafkaApp producing 2 messages for only 1 inputStack Overflow
版权声明:本文标题:apache kafka - App producing 2 messages for only 1 input - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742330334a2454564.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论