go-lang 1.18与confluent-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:
发布于 2022-05-24 09:16:03
偏移是在auto.commit.interval.ms中配置的间隔内提交的,默认为5秒。
将enable.auto.commit设置为false应该足以完全禁用自动提交。
https://stackoverflow.com/questions/72344647
复制相似问题