使用mq后,每次都会停在
10:26:18,457 INFO ContextLoader:285 - Root WebApplicationContext: initialization started
10:26:18,590 INFO XmlWebApplicationContext:510 - Refreshing Root WebApplicationContext: startup date [Tue Mar 06 10:26:18 CST 2018]; root of context hierarchy
10:26:18,649 INFO XmlBeanDefinitionReader:317 - Loading XML bean definitions from class path resource [applicationContext.xml]
10:26:18,996 INFO XmlBeanDefinitionReader:317 - Loading XML bean definitions from class path resource [applicationContext-dataSource.xml]
10:26:19,254 INFO XmlBeanDefinitionReader:317 - Loading XML bean definitions from class path resource [applicationContext-webService.xml]
10:26:19,396 INFO XmlBeanDefinitionReader:317 - Loading XML bean definitions from class path resource [applicationContext-quartz.xml]
10:26:19,414 INFO XmlBeanDefinitionReader:317 - Loading XML bean definitions from class path resource [applicationContext-mq.xml]那
配置文件为:
因为之前没有spring里面没有amq,所以每次启动的时候都会去线上查找,所以导致会很卡
http://activemq.apache.org/schema/core/activemq-core-5.8.0.xsd
解决方法:
配置spring的原生bean
将
<!-- ActiveMQ 连接工厂 -->
<amq:connectionFactory id="amqConnectionFactory"
brokerURL="tcp://localhost:61616" userName="admin" password="admin" />
改为:
<bean id="amqConnectionFactory"
class="org.apache.activemq.ActiveMQConnectionFactory">
<property name="brokerURL" value="tcp://localhost:61616"></property>
<property name="userName" value="admin"></property>
<property name="password" value="admin"></property>
</bean>