0
votes

I am using Spring Cloud stream with Kafka binder. To disable the auto-create topics I referred to this- How can I configure a Spring Cloud Stream (Kafka) application to autocreate the topics in Confluent Cloud?. But, it seems that setting this property is not working and the framework creates the topics automatically.

Here is the configuration in application.properties

spring.cloud.stream.kafka.binder.auto-create-topics=false

Here is the startup log

2021-06-25 09:22:46.522  INFO 38879 --- [pool-2-thread-1] o.a.k.clients.consumer.ConsumerConfig    : ConsumerConfig values: 
    allow.auto.create.topics = true
    auto.commit.interval.ms = 5000
    auto.offset.reset = latest
    bootstrap.servers = [localhost:9092]

Other details-

  1. Spring boot version: 2.3.12.RELEASE
  2. Spring Cloud Stream version: Hoxton.SR11

Am I missing anything in this configuration?

1

1 Answers

1
votes

spring.cloud.stream.kafka.binder.auto-create-topics=false

That property configures the binder so that it will not create the topics; it does not set that consumer property.

To explicitly set that property, also set

spring.cloud.stream.kafka.binder.consumer-properties.allow.auto.create.topics=false