+

Search Tips | Advanced Search

JMS connection factories

Applications running inside of WebSphere Application Server, that use a IBM MQ messaging provider connection factory to create connections and sessions, have active conversations for every JMS connection created from the connection factory, and for every JMS session created from a JMS connection.


One conversation for every JMS connection that has been created from the connection factory

Each JMS connection factory has an associated connection pool, divided into two sections, the free pool and the active pool. Both pools are initially empty.

When an application creates a JMS connection from a connection factory, WebSphere Application Server checks to see if there is a JMS connection in the free pool. If there is, it is moved to the active pool and given to the application. Otherwise, a new JMS connection is created, put in the active pool and returned to the application. The maximum number of connections that can be created from a connection factory is specified by the connection factory connection pool property Maximum connections. The default valuue for this property is 10.

After an application has finished with a JMS connection and closed it, the connection is moved from the active pool to the free pool, where it is available for reuse. The connection pool property Unused timeout defines how long a JMS connection can stay in the free pool before it is disconnected. The default value for this property is 1800 seconds (30 minutes).

When a JMS connection is first created, a conversation between WebSphere Application Server and IBM MQ starts. The conversation remains active until the connection is closed when value of the Unused timeout property for the free pool is exceeded.


One conversation for every JMS session that has been created from a JMS connection

Every JMS connection that is created from a IBM MQ messaging provider connection factory has an associated JMS session pool. There session pools work in the same way as connection pools. The maximum number of JMS Sessions that can be created from a single JMS connection is determined by the connection factory session pool property Maximum connections. The default value of this property is 10.

A conversation starts when a JMS session is first created, The conversation remains active until the JMS session is closed because it has remained in the free pool for longer than the value of the Unused timeout property for the session pool.


Calculating a value for the SHARECNV property

We can calculate the maximum number of conversations from a single connection factory to IBM MQ by using the following formula:
Maximum number of conversations =
    connection Pool Maximum Connections +
   (connection Pool Maximum Connections * Session Pool Maximum Connections) 
The number of channel instances that will be created to allow this number of conversations to take place can be worked out using the following calculation:
Maximum number of channel instances =
    Maximum number of conversations / SHARECNV for the channel being used 

Any remainder from this calculation can be rounded up.

For a simple connection factory that is using the default value for the connection pool Maximum connections and the session pool Maximum connections properties, the maximum number of conversations that can exist between WebSphere Application Server and IBM MQ for this connection factory is:
Maximum number of conversations =
   connection Pool Maximum Connections +
  (connection Pool Maximum Connections * Session Pool Maximum Connections) 
For example:
        = 10 + (10 * 10)
        = 10 + 100
        = 110
If this connection factory is connecting to IBM MQ using a channel that has the SHARECNV property set to 10, then the maximum number of channel instances that will be created for this connection factory is:
Maximum number of channel instances = Maximum number of conversations / SHARECNV for the channel being used
For example:
        = 110 / 10
        = 11 (rounded up to nearest connection) 
Parent topic: Determining the number of TCP/IP connections that are created from WebSphere Application Server to IBM MQ

Last updated: 2020-10-04