啓動項目時若是ActiveMQ沒有打開,控制檯一直報錯:java
WARN DefaultMessageListenerContainer:876 - Could not refresh JMS Connection for destination 'xxxxx' - retrying in 5000 ms. Cause: Could not connect to broker URL: tcp://localhost:61616. Reason: java.net.ConnectException: Connection refused: connectuartzSchedulerThread" spring
Exception in thread "org.springframework.jms.listener.DefaultMessageListenerContainetcp
緣由是實現了MQ的監聽,它會一直嘗試鏈接MQ。spa
不引用bean實現或監聽實現,這樣不會啓動數據監聽,註釋代碼或者配置bean便可。.net
把MQ的配置單提取到一個Spring配置文件裏,在導入這個文件的地方註釋掉導入。若是Spring bean使用註解依賴也要注意註釋掉依賴的bean。io