【问题标题】:Spring Cloud Stream vs Kafka Stream for Exactly Once featureSpring Cloud Stream 与 Kafka Stream 的 Exactly Once 功能
【发布时间】:2019-07-23 23:24:50
【问题描述】:

如果 Spring Cloud Stream 能够提供 Kafka Stream API 提供的“Exactly Once”语义,我无法在此处以及 Spring 网站和博客上找到。 也许没有单一的配置/注释,在线程“Is it possible to get exactly once processing with Spring Cloud Stream?”中我可以找到一些有用的东西,但答案是来自专家的非常高的水平。 感谢帮助

【问题讨论】:

  • 只有一次功能没有被限定为 Kafka 流。您可以编写自己的生产者并只发送一次消息。

标签: apache-kafka apache-kafka-streams spring-cloud-stream


【解决方案1】:

Spring Cloud Stream 在处理保证方面没有做任何特别的事情。您可以通过提供processing.guarantee 属性并将其设置为exactly-once 将其委托给Kafka Streams。有关详细信息,请参阅this。使用 Spring Cloud Stream Kafka Streams binder 时,您可以将其作为属性提供给 Spring Boot 应用程序,如下所示。

spring.cloud.stream.kafka.streams.binder.configuration.processing.guarantee.

请记住,Kafka Stream 的恰好一次保证仅在您将结果写回 Kafka 时才有效。

【讨论】:

    猜你喜欢
    • 2018-04-28
    • 2020-10-24
    • 2020-03-12
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-06-28
    相关资源
    最近更新 更多