kafka-配置-request.required.acks

0,

This value controls when a produce request is considered completed. Specifically, how many other brokers must have committed the data to their log and acknowledged this to the leader? Typical values are
0 , which means that the producer never waits for an acknowledgement from the broker (the same behavior as 0.7). This option provides the lowest latency but the weakest durability guarantees (some data will be lost when a server fails).

【0:producer push出消息之后,永远不会等待broker的ack】

1,

which means that the producer gets an acknowledgement after the leader replica has received the data. This option provides better durability as the client waits until the server acknowledges the request as successful (only messages that were written to the now-dead leader but not yet replicated will be lost).

【leader replica收到数据后,producer会得到一个ack;提供了更好的持久性,因为clienet能等到server收到ack;如果消息刚刚写到leader上,还没来得及复制leader就挂啦,那么消息就会丢失了。】

-1,

which means that the producer gets an acknowledgement after all in-sync replicas have received the data. This option provides the best durability, we guarantee that no messages will be lost as long as at least one in sync replica remains.
【所有在列的ISR in-sync-replica 都收到数据后才给producer一个ack】

http://www.tuicool.com/articles/aM32quv

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • A topic typically has multiple partitions, there is no gu...
    AlstonWilliams阅读 3,954评论 0 1
  • =========================================================...
    _灯火阑珊处阅读 7,112评论 0 3
  • 一天学一句 《弟子规》-59 原文:若衣服,若饮食;不如人,勿生戚。 注解:至于外表穿着或者饮食方...
    无名_a1f6阅读 3,229评论 0 2
  • 今天早上宝宝为我准备了一杯姜枣茶。有一片烤热的面包,还有一杯牛奶。宝宝每天早上都会陪我去上班,让我觉得特别温暖。我...
    嗳宁阅读 6,521评论 0 0
  • 时光匆匆,岁月总是无情的带走我们的青春。它可以剥夺我们青春的时间却剥夺不了我们青春的思想,抓住每一次机会,珍...
    杨平的阅读 3,157评论 1 0