apache-kafka - Kafka Streams中数据乱序原因

标签 apache-kafka apache-kafka-streams

您能帮我理解这段摘录吗?摘自 Kafka Streams documentation :

Within a stream task that may be processing multiple topic-partitions, if users configure the application to not wait for all partitions to contain some buffered data and pick from the partition with the smallest timestamp to process the next record, then later on when some records are fetched for other topic-partitions, their timestamps may be smaller than those processed records fetched from another topic-partition.

我不明白其中的逻辑:如果你选择时间戳最小的分区,为什么稍后会得到更小的时间戳?

最佳答案

我认为重要的部分是

if users configure the application to not wait for all partitions to contain some buffered data

由于我们不等待所有分区都有一些数据,因此流 S1S2 (T1 <T2):

  1. I2(带有时间戳 T2)到达 S2
  2. 由于没有其他可用数据,流读取 I2
  3. I1 时间戳为 T1 到达 S1
  4. 流读取 I1,其时间戳小于已处理的 I2

如果我们等到所有流都有数据,我们将从所有可用项目中选择最小的项目。由于我们不这样做,因此时间戳较小的项目可能会被延迟。

关于apache-kafka - Kafka Streams中数据乱序原因,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59330154/

相关文章:

scala - 如何将KeyValue列表发送到Kafka?

linux - 虚拟机中docker中与kafka的连接

java - Kafka Stream 如何使用 KTable#Suppress 发送最终聚合?

java - kafka流跳跃窗口聚合导致时间戳零时出现多个窗口

java - 使用 KStream 过滤掉阈值以外的值

apache-kafka - kafka是否具有规则引擎的能力?

apache-kafka - kafka主题分区重新平衡通知

apache-kafka - 无法启动动物园管理员

apache-kafka - 我们如何将相同键的所有值合并为一个列表,并返回键和值为字符串的 Kafka Streams

c# - Avro.AvroException : Array does not implement non-generic IList in field 异常