gpt4 book ai didi

spring-integration - Spring 集成流程的优雅关闭

转载 作者:行者123 更新时间:2023-12-01 14:40:42 25 4
gpt4 key购买 nike

我从spring integration monitoring sample中了解到 https://github.com/spring-projects/spring-integration-samples/tree/master/intermediate/monitoring如何使用控制总线关闭集成流程。我想知道怎么样

@integrationMBeanExporter.stopActiveComponents(false, 20000)

不同于仅仅关闭应用上下文

applicationContext.stop()

在其中加载流。那不会达到相同的结果吗?

最佳答案

其实你是对的。从高处看,他们对组件执行相同的操作:调用 Lifecycle.stop()

区别在于您的应用程序在第一种情况下继续工作并且您可以再次调用 Lifecycle.start()。而 IntegrationMBeanExporter 仅为集成组件执行此操作。

applicationContext.stop() 完全关闭 Spring 应用程序上下文 - 在大多数情况下只是停止整个应用程序。

关于spring-integration - Spring 集成流程的优雅关闭,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23295223/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com