| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- <?xml version="1.0" encoding="UTF-8"?>
- <beans xmlns="http://www.springframework.org/schema/beans"
- xmlns:mvc="http://www.springframework.org/schema/mvc"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:p="http://www.springframework.org/schema/p"
- xmlns:context="http://www.springframework.org/schema/context"
- xmlns:jms="http://www.springframework.org/schema/jms"
- xmlns:amq="http://activemq.apache.org/schema/core"
- xsi:schemaLocation="http://www.springframework.org/schema/beans
- http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
- http://www.springframework.org/schema/context
- http://www.springframework.org/schema/context/spring-context-3.0.xsd
- http://www.springframework.org/schema/mvc
- http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd
- http://www.springframework.org/schema/jms
- http://www.springframework.org/schema/jms/spring-jms-4.0.xsd
- http://activemq.apache.org/schema/core
- http://activemq.apache.org/schema/core/activemq-core-5.1.0.xsd">
- <!-- 连接 activemq-->
- <!--<amq:connectionFactory id="amqConnectionFactory" brokerURL="${activemq_url}" userName="${activemq_username}" password="${activemq_password}"/>-->
- <!-- 这里可以采用连接池的方式连接PooledConnectionFactoryBean -->
- <!-- <bean id="mqConnectionFactory" class="org.apache.activemq.ActiveMQConnectionFactory">-->
- <!-- <property name="brokerURL" value="${activemq_url}"/>-->
- <!-- <property name="userName" value="${activemq_username}"/>-->
- <!-- <property name="password" value="${activemq_password}"/>-->
- <!-- <!– 是否异步发送 –>-->
- <!-- <property name="useAsyncSend" value="true"/>-->
- <!-- </bean>-->
- <!-- <!– 定义消息队列topic类型,queue的方式差不多 –>-->
- <!-- <bean id="topic" class="org.apache.activemq.command.ActiveMQTopic">-->
- <!-- <!– 定义名称 –>-->
- <!-- <constructor-arg index="0" value="sendMessage"/>-->
- <!-- </bean>-->
- <!-- <!– 配置JMS模板(topic),Spring提供的JMS工具类,它发送、接收消息。 –>-->
- <!-- <bean id="jmsTemplate" class="org.springframework.jms.core.JmsTemplate">-->
- <!-- <property name="connectionFactory" ref="mqConnectionFactory"/>-->
- <!-- <property name="defaultDestination" ref="topic"/>-->
- <!-- <!– 非pub/sub模型(发布/订阅),true为topic,false为queue –>-->
- <!-- <property name="pubSubDomain" value="true"/>-->
- <!-- </bean>-->
- <!-- <bean id="sendMessageListener" class="cn.com.lzt.message.mq.SendMessageListener"/>-->
- <!-- <!– 监听方式,这种方式更实用,可以一直监听消息 –>-->
- <!-- <bean id="defaultMessageListenerContainer" class="org.springframework.jms.listener.DefaultMessageListenerContainer">-->
- <!-- <property name="connectionFactory" ref="mqConnectionFactory"/>-->
- <!-- <!– 注册activemq名称 –>-->
- <!-- <property name="destination" ref="topic"/>-->
- <!-- <property name="messageListener" ref="sendMessageListener"/>-->
- <!-- </bean>-->
- <!--<jms:listener-container destination-type="topic" container-type="default" connection-factory="mqConnectionFactory" acknowledge="auto">
- <jms:listener destination="topic" ref="sendMessageListener"/>
- </jms:listener-container>-->
- </beans>
|