kafka protocol_error ai_generated true

不支持的版本异常:代理不支持该API版本

org.apache.kafka.common.errors.UnsupportedVersionException: The broker does not support the API version

ID: kafka/unsupported-version-api

其他格式: JSON · Markdown 中文 · English
85%修复率
88%置信度
1证据数
2024-01-20首次发现

根因分析

客户端和代理的API版本不兼容,通常是由于Kafka客户端库和代理版本不匹配。

English

Client and broker have incompatible API versions, often due to mismatched Kafka client library and broker versions.

generic

官方文档

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

解决方案

  1. 升级Kafka客户端库以匹配代理版本,例如在Maven中:<kafka.version>3.7.0</kafka.version>
  2. 在生产/消费者配置中将 api.version.request 设置为 false,以强制客户端使用特定版本,例如 props.put("api.version.request", "false");

无效尝试

常见但无效的做法:

  1. 70% 失败

    Downgrading the broker version often introduces security vulnerabilities and is not recommended.

  2. 80% 失败

    Manually setting API versions in client config can lead to further incompatibilities if not done carefully.