I noticed with activemq (5.5) if I do this pseudocode:
connection = new ActiveMQConnectionFactory(...)
connection.start()
session = connection.createSession(transacted=true, Session.AUTO_ACKNOWLEDGE)
destination = session.createQueue(...)
consumer = session.createConsumer(destination)
That the consumer appears to grab an element from the queue, before I even request one. Even if I do wireFormat.cacheEnabled=false
Anybody know how to prevent a consumer from “grabbing an element” by default?
Add
&jms.prefetchPolicy.all=0to your connect string and see if that stops it. The prefetch policy defaults are fairly large and I suspect that’s the behavior you’re seeing.Be aware though that prefetch isn’t necessarily a bad thing: http://activemq.apache.org/what-is-the-prefetch-limit-for.html