I am trying to get JMS Consumers to work towards an ActiveMQ server however I am running into some issues which solution seem to just cause more problems.
I am using Spring's DMLC (cacheLeve set to CACHE_CONNECTION) together with a CachingConnectionFactory (cachingConsumers set to true) wrapping Activemq's own ConnectionFactory in a Webapp deployed in a Jboss AS.
According to this http://activemq.apache.org/what-is-the-prefetch-limit-for.html such a setup should have a prefetch set to 0 however in our tests when we did that we noticed that the DMLC calls the fetch command with a -1 timeout meaning it waits for messages from the broker forever and this in turn caused the web app to hang whenever we tried to undeploy it from the Jboss so it nevber actually gets undeployed.
Changing the prefetch to higher values causes messages to be stuck in the activemq as described in point 6 here http://tmielke.blogspot.se/2012/03/camel-jms-with-transactions-lessons.html where consumers never consume messages they prefetched.
It seems that however you go, you run into some problem. As a last resort I tried the AbortSlowAckConsumerStrategy setting on the broker side but that causes these consumers to be aborted very often and sounds like is not really the point of this setting.
Has anybody run into the same problem? Is there any way to setup cached consumers with a high prefetch for performance that does not run into trouble?