【问题标题】:enable.auto.commit value is not configuring to trueenable.auto.commit 值未配置为 true
【发布时间】:2017-12-08 08:20:54
【问题描述】:

根据 Kafka 文档,消费者配置 enable.auto.commit 的默认值为 true。但我越来越假了。

在我的 Kafka 流应用程序中,我尝试将其更改为 trueprops.put(StreamsConfig.consumerPrefix(ConsumerConfig.ENABLE_AUTO_COMMIT_CONFIG), true) 以自动提交偏移量。但我在日志中收到 WARN o.a.k.s.StreamsConfig [main] Unexpected user-specified consumer config: enable.auto.commit found. User setting (true) will be ignored and the Streams default setting (false) will be used 消息并恢复为 false。

原因是什么?请帮帮我。

【问题讨论】:

    标签: apache-kafka kafka-consumer-api apache-kafka-streams


    【解决方案1】:

    Kafka Streams 不允许用户设置enable.auto.commit。 Streams 使用自己的机制来提交偏移量,而不是依赖于消费者自动提交功能。这是为了确保只在库确定不会丢失数据的特定时间点完成提交。

    您可以控制的唯一提交设置是commit.interval.ms

    【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2021-08-01
    • 2020-03-04
    • 1970-01-01
    • 1970-01-01
    • 2019-11-30
    • 1970-01-01
    • 2015-11-06
    • 2015-08-27
    相关资源
    最近更新 更多