【问题标题】:Spring Kafka - How to set Commit Async propertySpring Kafka - 如何设置 Commit Async 属性
【发布时间】:2018-09-05 00:45:18
【问题描述】:

我正在尝试设置允许从 KafkaMessageListenerContainer 调用 commitAsync() 的属性:

if (this.containerProperties.isSyncCommits()) {
    this.consumer.commitSync(commits);
}
else {
    this.consumer.commitAsync(commits, is.commitCallback);
}

有没有办法在我的 application.yml 文件中设置它?我能够将 ack-mode 设置为 BATCH,但我找不到将容器属性的 syncCommits 设置为 false 的方法。

【问题讨论】:

    标签: spring spring-boot apache-kafka yaml spring-kafka


    【解决方案1】:

    该属性当前未公开为可在 YAML 中配置的引导属性。

    您可以覆盖 Boot 的默认 kafkaListenerContainerFactoryConfigurer bean 来执行容器的额外配置。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-11-24
      • 1970-01-01
      • 2019-06-24
      • 2017-11-08
      • 2021-10-14
      • 2022-01-06
      • 2019-09-01
      • 1970-01-01
      相关资源
      最近更新 更多