I have tested this scenario again and I have noticed something strange. Every time I run an integration test I check the queue with jconsole. Among the attributes of the queue that I am able to see in jconsole are four that caught my attention: CursorMemoryUsage, CursorPercentUsage, MemoryPercentUsage and MemoryUsageByteCount.
What I have noticed is that when the queue is purged the values of these attributes are set to 0. As long as the values are 0 AMQ does not send any ResourceAllocationException. These attributes are not updated with every message that enters the queue but after a certain period of time. After the attributes are updated AMQ starts sending the exception (as expected). It seems that AMQ compares the memoryLimit that I have setup (memoryLimit="1b") with one of these attributes (I think MemoryUsageByteCount) to see if it needs to throw the exception. This may very well explain the "delay" that I saw in my first tests. Does AMQ throw the ResourceAllocationException only when comparing one of these attributes (MemoryUsageByteCount?) with the memoryLimit configured for the queue or is this just a coincidence? And if so why are they not updated with every incoming message or at a faster pace? L. -- View this message in context: http://activemq.2283324.n4.nabble.com/ActiveMQ-ResourceAllocationException-is-delayed-tp4669871p4669912.html Sent from the ActiveMQ - User mailing list archive at Nabble.com.