I'm using Spring's JMSTemplate with ActiveMQ to publish messages into topics. My web service is Java SE Deployment with EndPoint. Once quotes are created or updated, my application publishes those quotes into topics. After publishing around 500+ messages, my application hungs as lsof on solaris box shows 1023 files already opened. Limitation on solaris box is 1024. Incrementing number of files can be opened, using 'ulimit' is not an option.
I'm using PooledConnectionFactory to pool JMS connection provider.
The following are my configuration on spring.xml:
<bean class="org.springframework.aop.framework.autoproxy .DefaultAdvisorAutoProxyCreator" >
<property name="proxyTargetClass" value="true"/>
</bean>
<bean id="jmsFactory" class="org.apache.activemq.pool.PooledConnectionFa ctory" destroy-method="stop">
<property name="connectionFactory">
<bean class="org.apache.activemq.ActiveMQConnectionFacto ry">
<property name="brokerURL">
<value>tcp://someurl:61616</value>
</property>
</bean>
</property>
</bean>
<bean id="jmsTemplate" class="org.springframework.jms.core.JmsTemplate">
<property name="connectionFactory" ref="jmsFactory" />
<property name="pubSubDomain" value="true" />
<property name="deliveryMode" value="1" />
</bean>
<bean id="gbRegularUpdateTopic" class="org.apache.activemq.command.ActiveMQTopic">
<constructor-arg index="0" value="grainbid.regular.update.topic" />
</bean>
<bean id="gbRegularUpdateJmsGateway" class="com.gb.jms.activemq.impl.GrainBidReportJmsG atewayImpl">
<property name="jmsTemplate" ref="jmsTemplate" />
<property name="destination" ref="gbRegularUpdateTopic"/>
</bean>
GrainBidReportJmsGatewayImpl uses spring's jmsTemplate.send(destination, MessageCreator) method to publish messages and messages are published into topics fine.
The following are my activeMQ.xml:
<broker useJmx="true" brokerName="color-app-dev.broker" dataDirectory="/data/activemq/data">
<destinations>
<topic physicalName="grainbid.regular.update.topic"/>
</destinations>
<destinationPolicy>
<policyMap>
<policyEntries>
<policyEntry queue=">" memoryLimit="5mb"/>
<policyEntry topic=">" memoryLimit="5mb"/>
</policyEntries>
</policyMap>
</destinationPolicy>
<persistenceAdapter>
<jdbcPersistenceAdapter dataDirectory="/data/activemq/data" dataSource="#oracle-ds" useDatabaseLock="true">
<statements>
<statements messageTableName="TAB_GB_ACTIVEMQ_MSGS" durableSubAcksTableName="TAB_GB_ACTIVEMQ_ACKS" lockTableName="TAB_GB_ACTIVEMQ_LOCK"/>
</statements>
</jdbcPersistenceAdapter>
</persistenceAdapter>
</broker>
What am I doing wrong? Please help me find out why are those files are not closed.


Reply With Quote
