欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

activeMQ连接失败问题-连接池配置处理  

程序员文章站 2024-01-13 12:08:28
...
<bean id="connectionFactory" class="org.apache.activemq.ActiveMQConnectionFactory">
    	<constructor-arg index="0" value="${amq.username}"/>
    	<constructor-arg index="1" value="${amq.password}"/>
    	<constructor-arg index="2" value="${amq.brokerurl}"/>
    	<property name="useAsyncSend" value="true"></property>
    	<property name="clientID" value="prod"></property>
    </bean>
		<!--new  add  begin-->
	<bean id="cachingConnectionFactory" class="org.springframework.jms.connection.CachingConnectionFactory">
		<property name="targetConnectionFactory" ref="connectionFactory"/>
		<property name="sessionCacheSize" value="100" />
	</bean>
          	<!--new  add  begin-->
    <bean id="singleConnectionFactory" class="org.springframework.jms.connection.SingleConnectionFactory">
    	<!--<property name="targetConnectionFactory" ref="connectionFactory"></property>-->
    	<property name="targetConnectionFactory" ref="cachingConnectionFactory"></property>
    </bean>