diff --git a/activemq-core/src/main/java/org/apache/activemq/broker/region/Queue.java b/activemq-core/src/main/java/org/apache/activemq/broker/region/Queue.java index 20afa8a97f..c4c9fff153 100755 --- a/activemq-core/src/main/java/org/apache/activemq/broker/region/Queue.java +++ b/activemq-core/src/main/java/org/apache/activemq/broker/region/Queue.java @@ -505,10 +505,8 @@ public class Queue extends BaseDestination implements Task, UsageListener { final ConnectionContext context = producerExchange.getConnectionContext(); synchronized (sendLock) { if (store != null && message.isPersistent()) { - if (isProducerFlowControl() && context.isProducerFlowControl() ) { - if (systemUsage.isSendFailIfNoSpace() && systemUsage.getStoreUsage().isFull()) { - throw new javax.jms.ResourceAllocationException("Usage Manager Store is Full"); - } + if (systemUsage.isSendFailIfNoSpace() && systemUsage.getStoreUsage().isFull()) { + throw new javax.jms.ResourceAllocationException("Usage Manager Store is Full"); } while (!systemUsage.getStoreUsage().waitForSpace(1000)) { if (context.getStopping().get()) { diff --git a/activemq-core/src/main/java/org/apache/activemq/broker/region/Topic.java b/activemq-core/src/main/java/org/apache/activemq/broker/region/Topic.java index 82992c9b13..8273ef83fc 100755 --- a/activemq-core/src/main/java/org/apache/activemq/broker/region/Topic.java +++ b/activemq-core/src/main/java/org/apache/activemq/broker/region/Topic.java @@ -399,10 +399,8 @@ public class Topic extends BaseDestination implements Task{ if (topicStore != null && message.isPersistent() && !canOptimizeOutPersistence()) { - if (isProducerFlowControl() && context.isProducerFlowControl() ) { - if (systemUsage.isSendFailIfNoSpace() && systemUsage.getStoreUsage().isFull()) { - throw new javax.jms.ResourceAllocationException("Usage Manager Store is Full"); - } + if (systemUsage.isSendFailIfNoSpace() && systemUsage.getStoreUsage().isFull()) { + throw new javax.jms.ResourceAllocationException("Usage Manager Store is Full"); } while (!systemUsage.getStoreUsage().waitForSpace(1000)) { if (context.getStopping().get()) {