spring 配置activemq网上大把的资料 这里不再去重复
但有一个问题在开发中特别烦人
activemq的配置采用xml schema,每次启动spring都要去远程验证xml文件
有时要等好久 有时服务直接当掉
所以考虑使用本地的xml schema
先把xml schema问价下载 保存到classpath下
然后如下配置
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:amq="http://activemq.org/config/1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://activemq.org/config/1.0 [color=red]classpath:activemq-core-5.0.0.xsd[/color]" > <amq:broker useJmx="false" persistent="false"> <amq:transportConnectors> <amq:transportConnector uri="tcp://localhost:0" /> </amq:transportConnectors> </amq:broker>
classpath:activemq-core-5.0.0.xsd就句指明了xml schema的文件位置
再次启动tomcat 速度飕飕滴
相关资源:spring activeMQ-demo 配置