Skip to content
Advertisement

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.

Advertisement

Answer

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.

See https://github.com/spring-cloud/spring-cloud-stream-binder-kafka/commit/4161f875ede0446ab1d485730c51e6a2c5baa37a

  • Change default replication factor to -1

Binder now uses a default value of -1 for replication factor signaling the broker to use defaults. 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.

In either case, if there is an admin policy that requires replication factor > 1, then that value must be used instead.

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement