I have configured `CachingConnectionFactory` that wraps a `MQTopicConnectionFactory` and `MQQueueConnectionFactory` with cache size set to 10 each.

These are than used in several `jms:outbound-channel-adapter or jms:message-driven-channel-adapter` as part of various spring integration workflows that I have in my application.

It is noticed that once in a while the connection count on MQ channel reaches maximum allowed (about 1000) when the process stops functioning. This is a serious problem for a production application.

Bringing the application down does not reduce the connection count so looks like orphaned connections on MQ side? I am not sure if I am missing anything in my spring jms / SI configuration that can resolve this issue, any help would be highly appreciated.

Also I would like to log connection open and close from application but don't see a way to do that.

```html
<bean id="mqQcf" class="com.ibm.mq.jms.MQQueueConnectionFactory">
//all that it needs host/port/ queue manager /channel
</bean>

 <bean id="qcf" class="org.springframework.jms.connection.CachingConnectionFactory">
            <property name="targetConnectionFactory" ref=" mqQcf "/>
            <property name="sessionCacheSize" value="10"/>          
</bean>

<bean id="mqTcf" class="com.ibm.mq.jms.MQTopicConnectionFactory">
//all that it needs host/port/ queue manager /channel
</bean>

<bean id="tcf" class="org.springframework.jms.connection.CachingConnectionFactory">
            <property name="targetConnectionFactory" ref=" mqTcf "/>
            <property name="sessionCacheSize" value="10"/>          
</bean>

//Qcf and tcf are than used in spring integration configuration as required

```