jms - Spring CachingConnectionFactory not reaping when idle -
i using spring cachingconnectionfactory
in below configuration cache mq sessions. can see caching working expected:
- it opens single mq connection
- creates new sessions needed , reuses them
my application has short lived peaks in message traffic. when there peak, session size bloats , remains there long after peak. looking way of reaping these idle sessions after specific period of inactivity. there anyway achieve this?
<jee:jndi-lookup id="mqqueueconnectionfactory" jndi-name="java:comp/env/jms/myjmsqueueconnectionfactory" /> <bean id="userconnectionfactory" class="org.springframework.jms.connection.usercredentialsconnectionfactoryadapter"> <property name="targetconnectionfactory" ref="mqqueueconnectionfactory"></property> </bean> <bean id="queueconnectionfactory" class="org.springframework.jms.connection.cachingconnectionfactory"> <property name="targetconnectionfactory" ref="userconnectionfactory"></property> <property name="reconnectonexception" value="${ssa.mq.cachesession}"></property> <property name="cacheproducers" value="${ssa.mq.cacheproducer}"></property> <property name="sessioncachesize" value="${ssa.mq.producer.sessionsize}"></property> <property name="cacheconsumers" value="${ssa.mq.cacheconsumers}"></property> </bean>
you can reduce sessioncachesize
; sessions closed when cache size exceeded physically closed next time used.
Comments
Post a Comment