【问题标题】:How to set the property acks = all in properties file of a spring boot application如何在 Spring Boot 应用程序的属性文件中设置属性 acks = all
【发布时间】:2020-09-15 12:48:25
【问题描述】:

我尝试了以下方法 spring.kafka.producer.acks= - 1 和 spring.cloud.stream.kafka.binder.requiredAcks= - 1

两者都不起作用,我的 MessageChannel.send() 在所有代理都关闭的情况下仍然返回 true

【问题讨论】:

    标签: apache-kafka spring-cloud-stream kafka-producer-api properties-file message-channel


    【解决方案1】:

    设置 acks=all 使用:

    spring.cloud.stream.kafka.binder.producer-properties.acks=all
    

    如果要为特定通道设置,请按如下方式覆盖:

    spring.cloud.stream.kafka.bindings.mytopicchannel.producer.configuration.acks=all
    

    参考:https://cloud.spring.io/spring-cloud-stream-binder-kafka/spring-cloud-stream-binder-kafka.html#_configuration_options

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-11-21
      • 2016-08-24
      • 2016-05-26
      • 2020-08-21
      • 1970-01-01
      • 2019-01-03
      • 2020-06-30
      • 2020-12-24
      相关资源
      最近更新 更多