From 7dca53d69055948c42ba6b38913f3223d2bc83d3 Mon Sep 17 00:00:00 2001 From: Bosanac Dejan Date: Tue, 22 Sep 2009 12:43:29 +0000 Subject: [PATCH] https://issues.apache.org/activemq/browse/AMQ-2400 - fixing tab spaces git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@817640 13f79535-47bb-0310-9956-ffa450edef68 --- .../apache/activemq/broker/region/Queue.java | 36 +++++++++---------- 1 file changed, 18 insertions(+), 18 deletions(-) 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 4467574ab4..2d0d1de0f3 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 @@ -412,9 +412,9 @@ public class Queue extends BaseDestination implements Task, UsageListener { isFull(context, memoryUsage); fastProducer(context, producerInfo); if (isProducerFlowControl() && context.isProducerFlowControl()) { - final String logMessage = "Usage Manager memory limit reached. Stopping producer (" + message.getProducerId() + ") to prevent flooding " + getActiveMQDestination().getQualifiedName() + "." + - " See http://activemq.apache.org/producer-flow-control.html for more info"; - LOG.info(logMessage); + final String logMessage = "Usage Manager memory limit reached. Stopping producer (" + message.getProducerId() + ") to prevent flooding " + getActiveMQDestination().getQualifiedName() + "." + + " See http://activemq.apache.org/producer-flow-control.html for more info"; + LOG.info(logMessage); if (systemUsage.isSendFailIfNoSpace()) { throw new javax.jms.ResourceAllocationException("SystemUsage memory limit reached"); } @@ -500,14 +500,14 @@ public class Queue extends BaseDestination implements Task, UsageListener { final ConnectionContext context = producerExchange.getConnectionContext(); synchronized (sendLock) { if (store != null && message.isPersistent()) { - if (systemUsage.getStoreUsage().isFull()) { - final String logMessage = "Usage Manager Store is Full. Stopping producer (" + message.getProducerId() + ") to prevent flooding " + getActiveMQDestination().getQualifiedName() + "." + - " See http://activemq.apache.org/producer-flow-control.html for more info"; - LOG.info(logMessage); - if (systemUsage.isSendFailIfNoSpace()) { - throw new javax.jms.ResourceAllocationException(logMessage); - } - } + if (systemUsage.getStoreUsage().isFull()) { + final String logMessage = "Usage Manager Store is Full. Stopping producer (" + message.getProducerId() + ") to prevent flooding " + getActiveMQDestination().getQualifiedName() + "." + + " See http://activemq.apache.org/producer-flow-control.html for more info"; + LOG.info(logMessage); + if (systemUsage.isSendFailIfNoSpace()) { + throw new javax.jms.ResourceAllocationException(logMessage); + } + } while (!systemUsage.getStoreUsage().waitForSpace(1000)) { if (context.getStopping().get()) { throw new IOException( @@ -1287,13 +1287,13 @@ public class Queue extends BaseDestination implements Task, UsageListener { final void sendMessage(final ConnectionContext context, Message msg) throws Exception { if (!msg.isPersistent() && messages.getSystemUsage() != null) { if (systemUsage.getTempUsage().isFull()) { - final String logMessage = "Usage Manager Temp Store is Full. Stopping producer (" + msg.getProducerId() + ") to prevent flooding " + getActiveMQDestination().getQualifiedName() + "." + - " See http://activemq.apache.org/producer-flow-control.html for more info"; - LOG.info(logMessage); - if (systemUsage.isSendFailIfNoSpace()) { - throw new javax.jms.ResourceAllocationException(logMessage); - } - } + final String logMessage = "Usage Manager Temp Store is Full. Stopping producer (" + msg.getProducerId() + ") to prevent flooding " + getActiveMQDestination().getQualifiedName() + "." + + " See http://activemq.apache.org/producer-flow-control.html for more info"; + LOG.info(logMessage); + if (systemUsage.isSendFailIfNoSpace()) { + throw new javax.jms.ResourceAllocationException(logMessage); + } + } messages.getSystemUsage().getTempUsage().waitForSpace(); } synchronized(messages) {