当acks = 0并且重试= 0时,Kafka Producer行为

时间:2019-03-28 11:57:46

标签: apache-kafka

根据Kafka文档,

acks=0 : the producer does not wait for the broker response but simply sends the data

acks=1 : a message is written to leader-log-file and a response is returned to the producer

但是在我的实际测试中,使用acks=1retries=0消息不会丢失

据我了解,以下配置应产生相同的输出:

retries=0, acks=0 
retries=0, acks=1 

因为acks = 1只是向生产者返回一个响应,告知消息是否成功接收,如果失败,则生产者可以根据重试重新发送消息。

但是,当重试= 0时,即使acks = 1,该消息也会因为失败而丢失数据,因为没有进行重试。

enter image description here

0 个答案:

没有答案