activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dej...@apache.org
Subject svn commit: r817639 - /activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/Topic.java
Date Tue, 22 Sep 2009 12:39:51 GMT
Author: dejanb
Date: Tue Sep 22 12:39:50 2009
New Revision: 817639

URL: http://svn.apache.org/viewvc?rev=817639&view=rev
Log:
https://issues.apache.org/activemq/browse/AMQ-2400 - producer flow control log messages for
topics

Modified:
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/Topic.java

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/Topic.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/Topic.java?rev=817639&r1=817638&r2=817639&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/Topic.java
(original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/Topic.java
Tue Sep 22 12:39:50 2009
@@ -281,8 +281,11 @@
             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);
                 if (systemUsage.isSendFailIfNoSpace()) {
-                    throw new javax.jms.ResourceAllocationException("Usage Manager memory
limit reached");
+                    throw new javax.jms.ResourceAllocationException(logMessage);
                 }
     
                 // We can avoid blocking due to low usage if the producer is sending
@@ -390,8 +393,13 @@
 
         if (topicStore != null && message.isPersistent()
                 && !canOptimizeOutPersistence()) {
-            if (systemUsage.isSendFailIfNoSpace() && systemUsage.getStoreUsage().isFull())
{
-                throw new javax.jms.ResourceAllocationException("Usage Manager Store is Full");
+            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()) {



Mime
View raw message