Issue Details (XML | Word | Printable)

Key: SPR-5110
Type: Improvement Improvement
Status: Open Open
Priority: Major Major
Assignee: Juergen Hoeller
Reporter: Pushan Bishi
Votes: 3
Watchers: 3
Operations

If you were logged in you would be able to see more operations.
Spring Framework

DefaultMessageListenerContainer stops receiving messages from an ActiveMQ Provider after a while

Created: 21/Aug/08 02:44 PM   Updated: 12/Jan/10 01:55 PM
Component/s: None
Affects Version/s: 2.5 final
Fix Version/s: 3.1 M2

Time Tracking:
Not Specified

Environment: Solaris
Issue Links:
Related
 


 Description  « Hide

I am running and ActiveMQ broker within JBoss. I have a Spring client which uses JMSTemplate/DefaultMessageListenerContainer to consume messages from 7 queues. When I bring up the client consumers, they run great for an hour or 2 and then they don't seem to receive any messages from the queues, though messages keep piling up in the queue. I see these messages which say that they are listening but not getting any messages

08:22:46.140 DEBUG[listenerContainer-2] [ ] [msg:] listener.DefaultMessageListenerContainer - Consumer [com.stc.jms.client.STCQueueReceiver@ae1cf] of session [com.stc.jms.client.STCSession@6ef7ba] did not receive a message
08:22:46.290 DEBUG[listenerContainer-5] [ ] [msg:] listener.DefaultMessageListenerContainer - Consumer [com.stc.jms.client.STCQueueReceiver@93c4f1] of session [com.stc.jms.client.STCSession@166c114] did not receive a message
08:22:46.540 DEBUG[listenerContainer-1] [ ] [msg:] listener.DefaultMessageListenerContainer - Consumer [com.stc.jms.client.STCQueueReceiver@1dae160] of session [com.stc.jms.client.STCSession@102679a] did not receive a message

Here are snippets from my Spring config

<bean id="highPriorityUploadListenerContainer" class="org.springframework.jms.listener.DefaultMessageListenerContainer" >
<property name="concurrentConsumers" value="15" />
<property name="connectionFactory" ref="jmsQueueConnectionFactory" />
<property name="destinationName" value="highPriorityUploadQueue" />
<property name="messageListener" ref="messageListener" />
<property name="cacheLevel" value="3" />
<property name="maxConcurrentConsumers" value="30" />
</bean>

<bean id="jmsQueueConnectionFactory" class="org.apache.activemq.pool.PooledConnectionFactory" destroy-method="stop">
<property name="maxConnections" value="100"/>
<property name="maximumActive" value="50"/>
<property name="connectionFactory">
<bean class="org.apache.activemq.ActiveMQConnectionFactory">
<property name="brokerURL" value="${activemq.jndi.url}"/>
</bean>
</property>

<bean id="highPriorityUploadQueue" class="com.citi.cfd.queue.impl.jms.JmsHandlerQueueImpl">
<property name="queueSender">
<bean id="highPriorityUploadJMSSender" class="com.citi.cfd.queue.impl.jms.JMSMessageSender">
<property name="jmsTemplate" >
<bean class="org.springframework.jms.core.JmsTemplate">
<property name="connectionFactory" ref="singleConnectionFactory" />
<property name="defaultDestinationName" value="highPriorityUploadQueue"/>
<property name="receiveTimeout" value="30000"/>
</bean>
</property>
<property name="dataSource" ref="dataSource"/>
</bean>
</property>
</bean>

<!-- Spring JMS Template -->
<bean id="singleConnectionFactory" class="org.springframework.jms.connection.SingleConnectionFactory">
<property name="targetConnectionFactory" ref="jmsQueueConnectionFactory"/>
</bean>



Juergen Hoeller added a comment - 22/Aug/08 02:23 AM

This seems to be related to SPR-5098, where a similar issue has been reported for the Sun JMS provider... This is very likely related to a JMS connection timeout that isn't propagated to DefaultMessageListenerContainer.

Juergen


Juergen Hoeller added a comment - 05/Sep/08 08:49 AM

This is generally speaking rather a bug in ActiveMQ, not in Spring.

JMS Connections that are still in active use should keep delivering messages. If the JMS consumers throwed IllegalStateExceptions, that would be clearer... simply not returning any messages there is not acceptable for a JMS provider. The ideal case would of course be for a JMS Connection to keep its physical connection alive for as long as it is in active use.

recommend reporting this issue to the ActiveMQ project.

Juergen