首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >enable.auto.offset.store=false的auto.commit = false的Kafka go-lang工作

enable.auto.offset.store=false的auto.commit = false的Kafka go-lang工作
EN

Stack Overflow用户
提问于 2022-05-23 07:22:02
回答 1查看 507关注 0票数 0

go-lang 1.18confluent-kafka-go v1.8.2的结合

使用enable.auto.commit = false配置。一旦消息成功处理,我们将手动提交偏移量。但是,即使在设置此配置之后,在处理过程中得到错误后,我们也不会看到具有相同键的消息。(这意味着即使在错误场景中,偏移也会被提交)。注意:对于错误场景,需要8-9秒的时间来处理,并将其完全称为错误。

也是从链接 It is recommended to set `enable.auto.offset.store=false` for long-time processing applications and then explicitly store offsets (using offsets_store()) after message processing, to make sure offsets are not auto-committed prior to processing has finished.那里得到的

Que:

  1. 默认情况下,卡夫卡要等多久才能自动提交偏移量。
  2. 我们有什么机制来阻止这个自动提交吗?
EN

回答 1

Stack Overflow用户

发布于 2022-05-24 09:16:03

偏移是在auto.commit.interval.ms中配置的间隔内提交的,默认为5秒。

enable.auto.commit设置为false应该足以完全禁用自动提交。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/72344647

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档