1 < context-param>
2 < param-name>brokerURI< /param-name>
3 < param-value>/WEB-INF/activemq.xml< /param-value>
4 < /context-param>
5
6 < listener>
7 < listener-class>org.activemq.web.SpringBrokerContextListener< /listener-class>
8 < /listener>将这一段代码放到web.xml里。注意到activemq.xml文件,是jms服务器的具体配置:
< ?xml version="1.0" encoding="UTF-8"?>
< !DOCTYPE beans PUBLIC "-//ACTIVEMQ//DTD//EN" "http://activemq.org/dtd/activemq.dtd">
< beans>
< !-- ==================================================================== -->
< !-- ActiveMQ Broker Configuration -->
< !-- ==================================================================== -->
< broker>
< connector>
< tcpServerTransport uri="tcp://localhost:61616" useAsyncSend="true" maxOutstandingMessages="50"/>
< /connector>
< !-- to enable Stomp support uncomment this
< connector>
< serverTransport uri="stomp://localhost:61626"/>
< /connector>
-->
< persistence>
< jdbcPersistence dataSourceRef="oracle-ds"/>
< /persistence>
< /broker>
< !-- ==================================================================== -->
< !-- JDBC DataSource Configurations -->
< !-- ==================================================================== -->
< !-- The Derby Datasource that will be used by the Broker -->
< bean id="derby-ds" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
< property name="driverClassName">
< value>org.apache.derby.jdbc.EmbeddedDriver< /value>
< /property>
< property name="url">
< !-- Use a URL like 'jdbc:hsqldb:hsql://localhost:9001' if you want to connect to a remote hsqldb -->
< value>jdbc:derby:derbydb;create=true< /value>
< /property>
< property name="username">
< value>< /value>
< /property>
< property name="password">
< value>< /value>
< /property>
< property name="poolPreparedStatements">
< value>true< /value>
< /property>
< /bean>
< /beans>
(责任编辑:包春林)