I am using jms:outbound-channel-adapter. We noticed that application server is starting way too many MQ connections. Application ultimately exhausts the maxChannel limit of MQ Server and starts getting :
Caused by: com.ibm.mq.MQException: JMSCMQ0001: WebSphere MQ call failed with compcode '2' ('MQCC_FAILED') reason '2537' ('MQRC_CHANNEL_NOT_AVAILABLE')
I am using MQTopicConnectionFactory, CachingConnectionFactory, outbound-channel-adapter.
Current configuration:
<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 integration flow having 250 concurrent threads, however, there are 2000+ MQ connections starting during peak load.
What is the significance of sessionCacheSize="10" in CachingConnectionFactory if the connections are exceeding 500?
How can I limit the MQ connections?
Can't JMS reuse the MQ connection from the a pool the way DB connections work?