1

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?

Morag Hughson
  • 7,255
  • 15
  • 44
Ramneek Handa
  • 53
  • 1
  • 10
  • I don't know how to answer the Spring questions you have, but you can increase the maxchannels the queue manager can handle, I can provide an answer for how to accomplish this if you like. – JoshMc Sep 30 '19 at 15:30
  • 1
    We can't increase maxChannels. It is a shared MQ(Messaging) server and 500 is more than enough. I would like to know why Spring JMS/Spring Integration outbound-channel-adapter is starting so many MQ connections? – Ramneek Handa Oct 04 '19 at 01:06
  • What version of mq queue manager and what version of mq jars? – JoshMc Oct 04 '19 at 01:39
  • IBM MQ dependencies are version 8.0.0.1 – Ramneek Handa Oct 04 '19 at 02:55
  • I'm facing the same issue, did it resolved? if so what was the change pls – Rafi Nov 15 '21 at 23:57

0 Answers0