[英]Not starting the JMS listener using jmsListenerEndpointRegistry.start()
I am trying to start the JMS listener using jmsListenerEndpointRegistry.start() which was stopped using jmsListenerEndpointRegistry.stop().我正在尝试使用 jmsListenerEndpointRegistry.start() 启动 JMS 侦听器,该侦听器使用 jmsListenerEndpointRegistry.stop() 停止。 But looks like it is not getting started.
但看起来它还没有开始。 When I am trying to consume the messages it is not allowing me to do so as it is still stopped.
当我尝试使用消息时,它不允许我这样做,因为它仍然停止。 Please help me how to start it back using start method.
请帮助我如何使用 start 方法重新启动它。 In application.properties I have spring.jms.listener.auto-startup=true
在 application.properties 我有spring.jms.listener.auto-startup=true
Using Apache ActiveMQ(Version-5.16.3)使用 Apache ActiveMQ(版本 5.16.3)
2022-01-06 16:27:54.699 INFO 28804 --- [nio-9091-exec-1] o.s.web.servlet.DispatcherServlet : FrameworkServlet 'dispatcherServlet': initialization completed in 22 ms
2022-01-06 16:27:54.726 ERROR 28804 --- [nio-9091-exec-1] com.jms.poc.controller.JmsController : --------- Trying to start JMS using jmsListenerEndpointRegistry.start()----------
2022-01-06 16:27:54.727 ERROR 28804 --- [nio-9091-exec-1] com.jms.poc.controller.JmsController : ----------jmsListenerEndpointRegistry.isRunning()-------- : false
There is no need to change the autoStartup
property in startJmsListener
- that property only applies when the application context is initialized.无需更改
startJmsListener
autoStartup
- 该属性仅在初始化应用程序上下文时适用。
You have no @JmsListenener
s - the only one is commented out.您没有
@JmsListenener
s - 唯一一个被注释掉了。
registry.isRunning()
only returns true when at least one of its containers is running. registry.isRunning()
仅在其至少一个容器正在运行时才返回 true。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.