activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rajdav...@apache.org
Subject svn commit: r961500 - /activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/Queue.java
Date Wed, 07 Jul 2010 20:31:41 GMT
Author: rajdavies
Date: Wed Jul  7 20:31:40 2010
New Revision: 961500

URL: http://svn.apache.org/viewvc?rev=961500&view=rev
Log:
Only start Producer Flow Control thread when needed

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

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/Queue.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/Queue.java?rev=961500&r1=961499&r2=961500&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/Queue.java
(original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/Queue.java
Wed Jul  7 20:31:40 2010
@@ -198,7 +198,7 @@ public class Queue extends BaseDestinati
                 }
             } catch (InterruptedException e) {
                 if (LOG.isDebugEnabled()) {
-                    LOG.debug("Producer Flow Control Timeout Task is stopping");
+                    LOG.debug(getName() + "P roducer Flow Control Timeout Task is stopping");
                 }
             }
         }
@@ -548,6 +548,12 @@ public class Queue extends BaseDestinati
                     // for space.
                     final ProducerBrokerExchange producerExchangeCopy = producerExchange.copy();
                     synchronized (messagesWaitingForSpace) {
+                     // Start flow control timeout task
+                        // Prevent trying to start it multiple times
+                        if (!flowControlTimeoutTask.isAlive()) {
+                            flowControlTimeoutTask.setName(getName()+" Producer Flow Control
Timeout Task");
+                            flowControlTimeoutTask.start();
+                        }
                         messagesWaitingForSpace.put(message.getMessageId(), new Runnable()
{
                             public void run() {
 
@@ -804,15 +810,6 @@ public class Queue extends BaseDestinati
         if (getExpireMessagesPeriod() > 0) {
             scheduler.schedualPeriodically(expireMessagesTask, getExpireMessagesPeriod());
         }
-
-        flowControlTimeoutTask.setName("Producer Flow Control Timeout Task");
-
-        // Start flow control timeout task
-        // Prevent trying to start it multiple times
-        if (!flowControlTimeoutTask.isAlive()) {
-            flowControlTimeoutTask.start();
-        }
-
         doPageIn(false);
     }
 



Mime
View raw message