Reputation: 864
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-
Am I missing anything in this configuration?
Upvotes: 2
Views: 3053
Reputation: 174779
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
Upvotes: 5