1
votes

I have a spring boot application which has two functionalities Http requests and kafka Messages handling. I want this application to run in mode which is enabled from application.yml i.e if the user wants to enable it only for http requests then kafka should not be connected.

I could achieve this using normal spring boot kafka plugin by disabling auto configure using the following property at @KafkaListener,

autoStartup="${module.put:false}"

Now we are trying to move to cloud stream and the only way I found to disable it by removing the libraries of cloud stream and binder. Is there any better way to disable it using properties with auto config mode or is there any manual config option available?

1

1 Answers

0
votes

The Spring Cloud Stream bindings also have autoStartup properties.

https://cloud.spring.io/spring-cloud-static/spring-cloud-stream/3.0.4.RELEASE/reference/html/spring-cloud-stream.html#_consumer_properties

autoStartup

Signals if this consumer needs to be started automatically

Default: true.