将”Acks”设置为”all”时,我在我的Kafka生产者中得到了”acks = -1″。

huangapple go评论69阅读模式
英文:

Getting acks = -1 when I set acks to all in my Kafka producer

问题

我在我的Kafka生产者上设置了以下属性:

properties.setProperty(ProducerConfig.ACKS_CONFIG, "all");

当我启动应用程序时,我在ProducerConfig values中看到acks = -1。这是为什么呢?

英文:

I set the following property on my Kafka producer:

properties.setProperty(ProducerConfig.ACKS_CONFIG, "all");

When I start my application I see acks = -1 in the ProducerConfig values. Why is this?

答案1

得分: 8

关于生产者配置,acks 属性的值为 -1 相当于 all

来自 Kafka 文档的生产者配置

acks=all 这意味着 leader 将等待完整的同步副本集确认记录。只要至少有一个同步副本保持活动状态,这就确保记录不会丢失。这是最强的可用保证。这相当于设置 acks=-1

英文:

For producer config, acks property of -1 is equal to all.

Producer config from Kafka documentation:

> acks=all This means the leader will wait for the full set of in-sync
> replicas to acknowledge the record. This guarantees that the record
> will not be lost as long as at least one in-sync replica remains
> alive. This is the strongest available guarantee. This is equivalent
> to the acks=-1 setting
.

huangapple
  • 本文由 发表于 2020年10月17日 20:27:28
  • 转载请务必保留本文链接:https://go.coder-hub.com/64402428.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定