浏览 2642 次
精华帖 (0) :: 良好帖 (0) :: 新手帖 (0) :: 隐藏帖 (0)
|
|
---|---|
作者 | 正文 |
发表时间:2008-09-23
<?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" 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-2.0.xsd"> <bean id="connectionFactory" class="org.apache.activemq.spring.ActiveMQConnectionFactory"> <property name="brokerURL" value="tcp://195.2.199.9:61616"/> <property name="useAsyncSend" value="true"/> </bean> <!-- 消息队列监听者(MDP) --> <bean id="queueMsgListener" class="com.cdmcs.oa.jms.MagMessageListener"/> <!-- 消息主题监听者(MDP) --> <bean id="topicMsgListener" class="com.cdmcs.oa.jms.MagTopicMsgListener"/> <bean id="jmsTransactionManager" class="org.jencks.factory.TransactionManagerFactoryBean"/> <!--监听容器--> <bean id="jencks" class="org.jencks.JCAContainer"> <property name="bootstrapContext"> <bean id="bootstrapContext" class="org.jencks.factory.BootstrapContextFactoryBean"> <property name="transactionManager" ref="jmsTransactionManager"/> <property name="threadPoolSize" value="25"/> </bean> </property> <property name="resourceAdapter"> <bean id="activeMQResourceAdapter" class="org.apache.activemq.ra.ActiveMQResourceAdapter"> <property name="serverUrl" value="tcp://195.2.199.9:61616"/> </bean> </property> </bean> <!--队列监听:消费队列消息--> <bean id="queueListener" class="org.jencks.JCAConnector"> <property name="jcaContainer" ref="jencks"/> <property name="activationSpec"> <bean class="org.apache.activemq.ra.ActiveMQActivationSpec"> <property name="destination" value="my.queue"/> <property name="destinationType" value="javax.jms.Queue"/> </bean> </property> <property name="ref" value="queueMsgListener"/> <!--队列监听器--> </bean> <!--主题监听:消费主题消息--> <bean id="topicListener" class="org.jencks.JCAConnector"> <property name="jcaContainer" ref="jencks"/> <property name="activationSpec"> <bean class="org.apache.activemq.ra.ActiveMQActivationSpec"> <property name="destination" value="my.topic"/> <property name="destinationType" value="javax.jms.Topic"/> <!--持久订阅配置--> <property name="clientId" value="clientId_003"/> <property name="subscriptionName" value="clientId_003"/> <property name="subscriptionDurability" value="Durable"/> </bean> </property> <property name="ref" value="topicMsgListener"/> <!--主题监听器--> </bean> <!--消息发送模板--> <bean id="jmsQueueTemplate" class="org.springframework.jms.core.JmsTemplate102"> <property name="connectionFactory" ref="connectionFactory"/> <property name="messageConverter" ref="simpleConverter"/> <property name="sessionTransacted" value="true"/> <property name="receiveTimeout" value="10000"/> </bean> <bean id="jmsTopicTemplate" class="org.springframework.jms.core.JmsTemplate102"> <property name="connectionFactory" ref="connectionFactory"/> <property name="messageConverter" ref="simpleConverter"/> <property name="pubSubDomain" value="true"/> <property name="sessionTransacted" value="true"/> <property name="receiveTimeout" value="10000"/> </bean> <bean id="simpleConverter" class="org.springframework.jms.support.converter.SimpleMessageConverter" /> </beans> 声明:ITeye文章版权属于作者,受法律保护。没有作者书面许可不得转载。
推荐链接
|
|
返回顶楼 | |
发表时间:2008-10-09
链接URL修改成这样试试
failover://(tcp://195.2.199.9:61616)?initialReconnectDelay=100 |
|
返回顶楼 | |
发表时间:2008-10-09
mariner 写道 链接URL修改成这样试试 failover://(tcp://195.2.199.9:61616)?initialReconnectDelay=100 多谢,这样配置的确可以解决: <property name="serverUrl" value="failover://(tcp://195.2.199.9:61616)&maxReconnectDelay=1000"/> |
|
返回顶楼 | |