英文:
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.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论