出站通道适配器/ Spring JMS启动了太多的MQ连接

时间:2019-09-30 14:49:31

标签: spring-integration ibm-mq spring-jms jms-topic

我正在使用jms:outbound-channel-adapter。 我们注意到应用程序服务器正在启动太多的MQ连接。应用程序最终耗尽了MQ Server的maxChannel限制,并开始获取:

Caused by: com.ibm.mq.MQException: JMSCMQ0001: WebSphere MQ call failed with compcode '2' ('MQCC_FAILED') reason '2537' ('MQRC_CHANNEL_NOT_AVAILABLE')

我正在使用 MQTopicConnectionFactory,CachingConnectionFactory,outbound-channel-adapter

当前配置:

<bean id="mqQueueConnectionFactory" class="com.ibm.mq.jms.MQTopicConnectionFactory">
   <property name="SSLCipherSuite" value="${mq.sslCipherSuite}"/>
   <property name="hostName" value="${mq.hostName}"/>
   <property name="port" value="${mq.port}"/>
   <property name="channel" value="${mq.channel}"/>
   <property name="transportType" value="1"/>
</bean>
<bean id="cachedConnectionFactory"
    class="org.springframework.jms.connection.CachingConnectionFactory"
    p:targetConnectionFactory-ref="jmsTConnectionFactory"
    p:reconnectOnException="true" p:sessionCacheSize="10"
    p:cacheProducers="true" />  
<bean id="senderTopic" class="com.ibm.mq.jms.MQTopic" > 
    <constructor-arg value="${mq.topicName}"/>  
</bean> 
<bean id="jmsQueueTemplate" class="org.springframework.jms.core.JmsTemplate">
   <property name="connectionFactory">
      <ref bean="cachedConnectionFactory" />
   </property>
   <property name="defaultDestination">
      <ref bean="senderTopic" />
   </property>
</bean>

Outbound-channel-adapter:

<int-jms:outbound-channel-adapter
    id="jmsOutToNE" channel="umpAlertNotificationJMSChannel"
    destination="senderTopic" jms-template="jmsQueueTemplate">
    <!-- <int:retry-advice/> -->
</int-jms:outbound-channel-adapter>

Spring集成流具有250个并发线程,但是,在高峰负载期间开始有2000多个MQ连接。

如果连接数超过500,则在CachingConnectionFactory中 sessionCacheSize =“ 10” 的意义是什么?

如何限制MQ连接?

JMS不能以DB连接的工作方式从池中重用MQ连接吗?

0 个答案:

没有答案
相关问题