【发布时间】:2015-01-05 19:27:46
【问题描述】:
我已经配置了 CachingConnectionFactory,它包装了 MQTopicConnectionFactory 和 MQQueueConnectionFactory,每个缓存大小设置为 10。
这些在多个jms:outbound-channel-adapter or jms:message-driven-channel-adapter 中使用,作为我在我的应用程序中拥有的各种 Spring 集成工作流的一部分。
注意到,当进程停止运行时,MQ 通道上的连接数偶尔会达到允许的最大值(大约 1000)。这对于生产应用程序来说是一个严重的问题。
关闭应用程序并不会减少连接数,因此看起来像是 MQ 端的孤立连接?我不确定我的 spring jms / SI 配置中是否遗漏了可以解决此问题的任何内容,我们将不胜感激。
我也想记录从应用程序打开和关闭的连接,但没有办法做到这一点。
<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
【问题讨论】:
-
有什么解决办法吗?
标签: spring-integration ibm-mq spring-jms