简体   繁体   中英

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(). 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. In application.properties I have spring.jms.listener.auto-startup=true

Using Apache ActiveMQ(Version-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.

You have no @JmsListenener s - the only one is commented out.

registry.isRunning() only returns true when at least one of its containers is running.

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM