gpt4 book ai didi

message-queue - Kafka 0.8 生产者,使用 "request.required.acks"属性

转载 作者:行者123 更新时间:2023-12-01 06:32:38 26 4
gpt4 key购买 nike

来自 0.8 Documentation在生产者配置下
属性(property)request.required.acks

value controls when the producer receives an acknowledgement from the broker.

Typical values are

(1) 0, which means that the producer never waits for an acknowledgement from the broker

(2) 1, which means that the producer gets an acknowledgement after the leader replica has received the data

(3) -1, which means that the producer gets an acknowledgement after all in-sync replicas have received the data


request.required.acks 时,我如何在生产者中收到此确认值为 1 . producer.send(MessageKey)作为一个空白我找不到任何选项来检索它。

最佳答案

生产者发送的 API 有很多不足之处,尤其是在异步模式下。这些 ack 对生产者对象的用户是隐藏的。如果它们失败,您最终会看到异常。

异步情况下的问题是您不知道失败的批次是从哪里开始的,因此如果您想稍后重试发送,则需要进行一些猜测。

似乎有计划在 future 的版本(> 0.8.0)中改进这一点。

关于message-queue - Kafka 0.8 生产者,使用 "request.required.acks"属性,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18475125/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com