简体   繁体   English

Kafka 生产者配置:为什么 request.timeout.ms 应该大于 replica.lag.time.max.ms

[英]Kafka producer config: Why request.timeout.ms should be larger than replica.lag.time.max.ms

From Kafka doc https://kafka.apache.org/11/documentation.html#producerconfigs , it says that:来自 Kafka doc https://kafka.apache.org/11/documentation.html#producerconfigs ,它说:

The configuration controls the maximum amount of time the client will wait for the response of a request.该配置控制客户端等待请求响应的最长时间。 If the response is not received before the timeout elapses the client will resend the request if necessary or fail the request if retries are exhausted.如果在超时之前未收到响应,客户端将在必要时重新发送请求,或者如果重试次数耗尽则请求失败。 This should be larger than replica.lag.time.max.ms (a broker configuration) to reduce the possibility of message duplication due to unnecessary producer retries.这应该大于 replica.lag.time.max.ms(代理配置)以减少由于不必要的生产者重试而导致消息重复的可能性。

Why a small request.timeout.ms may cause duplication?为什么一个小的 request.timeout.ms 可能会导致重复? Could someone elaborate more on that?有人可以详细说明吗?

And does this still hold true if the producer retries config is set to 0?如果生产者重试配置设置为 0,这是否仍然适用?

if it's smaller than replica.lag.time.max.ms, then follower broker might persistent the msg successfully but producer req timed out, which will cause the duplication due to unnecessary producer retries如果它小于 replica.lag.time.max.ms,那么 follower broker 可能会成功持久化 msg 但 producer req 超时,这将由于不必要的 producer 重试而导致重复

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在 Kafka 消费者配置中将 max.poll.interval.ms 设置为大于 request.timeout.ms 的负面影响是什么 - What is negative effects of setting max.poll.interval.ms larger than request.timeout.ms in Kafka consumer configs Spring 用于 Apache Kafka:无法识别的生产者配置 - 'delivery.timeout.ms' - Spring for Apache Kafka: Unrecognized producer configuration - 'delivery.timeout.ms' Kafka Producer请求超时设置 - Kafka Producer Request Timeout setting Kafka Producer 错误:使用 timeoutMillis = 9223372036854775807 ms 关闭 Kafka 生产者 - Kafka Producer error: Closing the Kafka producer with timeoutMillis = 9223372036854775807 ms Kafka 事务生产者抛出“在 60000 毫秒内初始化事务 state 时超时已过期” - Kafka transactional producer throws 'Timeout expired while initializing transactional state in 60000ms' 当Kafka消费者不使用订阅方法时,是否检查session.timeout.ms或max.pool.interval.ms? - When Kafka consumer don't use subscribe method, do it check session.timeout.ms or max.pool.interval.ms? Apache Kafka-了解在poll()方法中作为参数存在的超时与fetch.max.wait.ms之间的关系 - Apache Kafka- Understanding the relationship between timeout present as a parameter in the poll() method and fetch.max.wait.ms 异步 Kafka Producer 批量大小 a linger.ms - Asynchronous Kafka Producer batch size a linger.ms Kafka生产者未来超时 - Kafka producer future get timeout Kafka Producer NetworkException 和超时异常 - Kafka Producer NetworkException and Timeout Exceptions
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM