在我运行在Tomcat中的webapp中,有两个Spring5.0.2类实现了SmartLifecycle。他们像预期的一样开始,但不要停止。下面是我实现的与停止相关的SmartLifeCycle方法(这两个类都是相同的)。为什么stop没有被执行?任何调试提示也欢迎。@Componentpublic class MyQueue1 implements SmartLifecyclepublic
为了在应用程序停止时干净利落地关闭(并避免难看的Netty堆栈跟踪),我将takeUntil()与一个EmitterProcessor实例一起使用,当Spring停止我的bean (我实现了SmartLifecycle整个过程是这样的: @Component@Slf4j
public class LongPollingMessageReceiver implements SmartLifecycle