kafka config_error ai_generated true

org.apache.kafka.common.errors.InvalidRequiredAcksException:必需的 acks 值无效。

org.apache.kafka.common.errors.InvalidRequiredAcksException: The required acks value is invalid.

ID: kafka/invalid-required-acks

其他格式: JSON · Markdown 中文 · English
90%修复率
90%置信度
1证据数
2023-12-05首次发现

根因分析

生产者发送了具有无效 'acks' 值(例如 -2 或 3)的请求,该值不在允许的 -1、0 或 1 集合中。

English

The producer sent a request with an invalid 'acks' value (e.g., -2 or 3) that is not in the allowed set of -1, 0, or 1.

generic

官方文档

https://kafka.apache.org/documentation/#producerconfigs_acks

解决方案

  1. Set acks to a valid value in the producer properties: `props.put('acks', 'all')` (equivalent to -1) or `props.put('acks', '1')`. Example fix: change `acks=-2` to `acks=1`.

无效尝试

常见但无效的做法:

  1. 80% 失败

    Setting acks to 'all' (string) instead of -1 (integer) in the producer config causes a different error; this error specifically catches invalid integer values.

  2. 100% 失败

    Ignoring the error and retrying with the same value will fail repeatedly; the config must be corrected.