How can a producer set up from a Kafka factory be disabled?
I started from this example from https://docs.spring.io/spring-kafka/reference/html/
I expected that adding a property like
props.put("autoStartup", "false");
would disable the message sending, but it does not seem to work. Running the application still sends messages.
There's no producer property like autoStartup
, so it doesn't mean disable the message sending
. For the producer configuration, you could see here .
In Spring Kafka, autoStartup
is used for Listener Container .
You could set this property by: In @KafkaListener
@KafkaListener(id = "myContainer", topics = "myTopic", autoStartup = "false")
Or
**ListenerContainerFactory.setAutoStartup(Boolean autoStartup)
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.