sendFailIfNoSpace only works for MemoryUsage, not disk usage
------------------------------------------------------------
Key: AMQ-1717
URL: https://issues.apache.org/activemq/browse/AMQ-1717
Project: ActiveMQ
Issue Type: Bug
Components: Broker
Affects Versions: 5.1.0
Reporter: Steve Shabino
We have a use case where we do not want to wait for ActiveMQ if allocated disk
space is used up. So, we set sendFailIfNoSpace to true in the SystemUsage
object.
Expected: Setting sendFailIfNoSpace should cause an immediate exception when
attempting to send a message if StoreUsage is at or above the max allowed.
Actual: ActiveMQ blocks until disk space is available.
Some analysis of the code shows that org.apache.activemq.broker.region.Queue's
send method only throws an exception if MemoryUsage is full:
{code}
if (isProducerFlowControl() && context.isProducerFlowControl() &&
memoryUsage.isFull()) {
if (systemUsage.isSendFailIfNoSpace()) {
throw new javax.jms.ResourceAllocationException("SystemUsage
memory limit reached");
}
}
{code}
We worked around the problem with our embedded broker set-up by explicitly
calling StoreUsage.isFull() before sending messages.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.