Search code examples
spring-bootapache-kafkaapache-kafka-streamsspring-kafka

Springboot-KStream: Multiple StreamsConfig.APPLICATION_ID_CONFIG setup


Could you please help me to setup multiple APPLICATION_ID_CONFIG in a springboot project, so that we can assign different NUM_STREAM_THREADS_CONFIG to each of them.

Let say, In my current topology I have 2 processors , one of them is real fast and other one is CPU intensive. Assembling them in same stream results the cpu intensive task to fall behind. If I could setup 2 separate application, then I might assign more threads to cpu intensive task.

Thanks in advance.


Solution

  • You need to configure a second StreamsBuilderFactoryBean. Spring Boot will configure one from the application properties; configure a second one with different properties. See the documentation.