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】
网友评论