简体   繁体   English

创建主题失败","异常":"\norg.apache.kafka.common.errors.UnsupportedVersionException

[英]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/4161f875ede0446ab1d485730c51e6a2c5baa37ahttps://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.

相关问题 发现异常.....org.apache.kafka.common.KafkaException:无法使用自定义对象序列化程序构建 kafka 生产者 - Exception found.....org.apache.kafka.common.KafkaException: Failed to construct kafka producer using custom object Serializer 获取间歇性 KafkaProducerException:无法发送 org.apache.kafka.common.errors.TimeoutException - Getting intermittent KafkaProducerException: Failed to send org.apache.kafka.common.errors.TimeoutException 发送 avro 消息时出现异常,异常是 org.apache.kafka.common.errors.SerializationException:注册 Avro 架构时出错: - Getting exception while sending avro message, exception is org.apache.kafka.common.errors.SerializationException: Error registering Avro schema: 线程“StreamThread-1”中的异常org.apache.kafka.streams.errors.StreamsException:无法重新平衡 - Exception in thread “StreamThread-1” org.apache.kafka.streams.errors.StreamsException: Failed to rebalance org.apache.kafka.common.errors.SerializationException:未知的魔法字节 - org.apache.kafka.common.errors.SerializationException: Unknown magic byte 线程“main”org.apache.kafka.streams.errors.InvalidStateStoreException 中的异常: - Exception in thread "main" org.apache.kafka.streams.errors.InvalidStateStoreException: Azure eventthub Kafka org.apache.kafka.common.errors.TimeoutException 对于一些记录 - Azure eventhub Kafka org.apache.kafka.common.errors.TimeoutException for some of the records 除了线程“main”org.apache.kafka.common.KafkaException:无法构建kafka消费者 - Except in thread "main" org.apache.kafka.common.KafkaException: Failed to construct kafka consumer 如何在 apache kafka 中获取所有主题? - How to get All Topics in apache kafka? Kafka 流异常:org.apache.kafka.streams.errors.StreamsException - 反序列化异常处理程序 - Kafka streams Exception: org.apache.kafka.streams.errors.StreamsException - Deserialization exception handler
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM