Venkatesh Laguduva
Venkatesh Laguduva

Reputation: 14408

Queue Consumers have pending messages but they are not getting processed

I am using the combination of activemq, camel and spring. For queues, we have multiple consumers on them; On some queue consumers, we see that there are pending messages (goes upto 100 which is same as prefetch) and they are not getting processed at all but other consumers for the same queue, it is business as usual.

I looked into deeper to understand what's happening and found that spring cachingconnectionfactory could be causing this issue - we are suspecting that this caching connection factory could be making some clients as inactive and messages left in their prefetch buffer are not getting processed. Are we right in our findings?

Apart from this, is there any way we can get the messages from the prefetch buffer released from the inactive consumers?

Upvotes: 2

Views: 1242

Answers (1)

Gary Russell
Gary Russell

Reputation: 174829

You must not use a CachingConnectionFactory with variable concurrency, or you must disable caching of consumers; see the javadocs for DefaultMessageListenerContainer.

 * <p><b>Note: Don't use Spring's {@link org.springframework.jms.connection.CachingConnectionFactory}
 * in combination with dynamic scaling.</b> Ideally, don't use it with a message
 * listener container at all, since it is generally preferable to let the
 * listener container itself handle appropriate caching within its lifecycle.

Otherwise idle consumers will be put in the cache.

Upvotes: 2

Related Questions