怎么可以生产者设立的从卡夫卡的工厂被禁用?
我开始从这个例子 https://docs.spring.io/spring-kafka/reference/html/
我预计,增加一个酒店似的
props.put("autoStartup", "false");
将禁止的消息发送,但它似乎没有工作。 运行的应用程序仍将发送消息。
怎么可以生产者设立的从卡夫卡的工厂被禁用?
我开始从这个例子 https://docs.spring.io/spring-kafka/reference/html/
我预计,增加一个酒店似的
props.put("autoStartup", "false");
将禁止的消息发送,但它似乎没有工作。 运行的应用程序仍将发送消息。
有没有生产者财产像 autoStartup
,因此,这并不意味着 disable the message sending
. 对于生产者的配置,你可以看到 在这里.
在弹簧卡夫卡, autoStartup
用于 监听的容器.
你可以设置这种财产:
在 @KafkaListener
@KafkaListener(id = "myContainer", topics = "myTopic", autoStartup = "false")
或
**ListenerContainerFactory.setAutoStartup(Boolean autoStartup)
disable the kafka producer
. @KafkaListener
只是用于消费者(ListenerContainer
). 一KafkaTemplate发送你的消息上的需求,所以,如果你想停止,只是不要叫它。