[英]Failed to create topics","exception":"\norg.apache.kafka.common.errors.UnsupportedVersionException
{
"mdc":{
},
"timestamp":"2021-05-11 11:48:04.055",
"level":"ERROR",
"logger":"org.springframework.cloud.stream.binder.kafka.provisioning.KafkaTopicProvisioner",
"message":"Failed to create topics",
"exception":"\"\norg.apache.kafka.common.errors.UnsupportedVersionException: Creating topics with default partitions/replication factor are only supported in CreateTopicRequest version 4+. The following topics need values for partitions and replicas:"
Please suggest what changes are required as i am getting this error.请建议我收到此错误时需要进行哪些更改。
I see you are new here.我看你是新来的。 You should always include version information and full stack trace for questions like this.
对于此类问题,您应该始终包含版本信息和完整的堆栈跟踪。
Upgrade your broker to >= 2.4 or set the binder replication factor property.将您的代理升级到 >= 2.4 或设置活页夹复制因子属性。
See https://github.com/spring-cloud/spring-cloud-stream-binder-kafka/commit/4161f875ede0446ab1d485730c51e6a2c5baa37a见https://github.com/spring-cloud/spring-cloud-stream-binder-kafka/commit/4161f875ede0446ab1d485730c51e6a2c5baa37a
- Change default replication factor to -1
将默认复制因子更改为 -1
Binder now uses a default value of -1 for replication factor signaling the broker to use defaults.
Binder 现在使用默认值 -1 作为复制因子,指示代理使用默认值。 Users who are on Kafka brokers older than 2.4, need to set this to the previous default value of 1 used in the binder.
使用 Kafka 代理的早于 2.4 的用户需要将其设置为以前在活页夹中使用的默认值 1。
In either case, if there is an admin policy that requires replication factor > 1, then that value must be used instead.
在任何一种情况下,如果存在要求复制因子 > 1 的管理策略,则必须改用该值。
Overriding the default replication factor(-1) with a non negative value fixed the issue for me.用非负值覆盖默认复制因子(-1)解决了我的问题。
spring.cloud.stream.kafka.binder.replication-factor=1
For application.yaml
file use:对于
application.yaml
文件使用:
spring.cloud.stream.kafka.binder.replicationFactor: 1
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.