ibm-messaging / mq-jms-spring

Components to assist MQ JMS integration with Spring frameworks
Apache License 2.0
187 stars 102 forks source link

Relation between JMS Connection / Session / Consumer and MQ connections #62

Closed hanson76 closed 3 years ago

hanson76 commented 3 years ago

Please include the following information in your ticket.

We are seeing lot more tcp connections between our application and the IBM MQ queue manager than we expect. The queue manager has a set limit of 250 connections and we are hitting it even when we think that we have configure our application to use jms connection pooling and setting the pool to max 1 connection. Relevant config is stated below

The application is listening to more than 50 different queues.

What is the relation between the JMS Connection, Session, Consumer and the tcp connections that are created?

We have an application with the following configuration set:

ibm.mq.pool.enabled = true
ibm.mq.pool.maxConnections = 1 (default)
ibm.mq.pool.maxSessionsPerConnection = 500 (default)

spring.jms.listener.concurrency = 1
spring.jms.listener.max-concurrency = 50
ibmmqmet commented 3 years ago

Each JMS connection and session is effectively a separate MQ connection. So a simple JMS app with a connection+session will usually show up as 2 MQCONN handles. MQCONNs then use the channel SHRCONV value to determine how many connections are established on the same TCP socket. Though the best value for SHRCONV is usually 1, so each MQCONN = 1 socket.

hanson76 commented 3 years ago

That explains the behavor we see.

ibmmqmet commented 3 years ago

closing as answered

dinegri commented 5 months ago

Each JMS connection and session is effectively a separate MQ connection. So a simple JMS app with a connection+session will usually show up as 2 MQCONN handles. MQCONNs then use the channel SHRCONV value to determine how many connections are established on the same TCP socket. Though the best value for SHRCONV is usually 1, so each MQCONN = 1 socket.

Which kind of data pass through each connection, because I have this situation as well and 1 connection I always see 4 messages received and another one I able to see the messages my app is sending