Skip to content
Advertisement

Spring Boot Kafka StreamsConfig or ConsumerConfig from application.yaml not applying

I have a very simple spring boot project with a KTable and I want to customize my configuration in application.yml, but the config seems to not be applied. This is my configuration file application.yml

JavaScript

However, when starting the application the log outputs the following:

JavaScript

ConsumerConfig:

JavaScript

Below is the simple application class I’m using:

JavaScript

The values from my application.yml seems to be ignored. What could be the cause of this? What am I missing? Thanks in advance!

Advertisement

Answer

So I figured it out with the help of How do I properly externalize spring-boot kafka-streams configuration in a properties file?.

Apparently, consumer and producer configs are completely separated from streams config when using a KStream. To set specific properties for the consumer of the kafka stream one must use “additional properties” like so:

JavaScript

which was a bit unintuitive, but it works. Hope this can help someone in the future!

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