activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rajdav...@apache.org
Subject svn commit: r603884 - in /activemq/trunk/activemq-core/src/main/java/org/apache/activemq: broker/region/Topic.java transaction/Transaction.java
Date Thu, 13 Dec 2007 11:02:21 GMT
Author: rajdavies
Date: Thu Dec 13 03:02:18 2007
New Revision: 603884

URL: http://svn.apache.org/viewvc?rev=603884&view=rev
Log:
Add warning message if not enough space to complete a transaction

Modified:
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/Topic.java
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transaction/Transaction.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=603884&r1=603883&r2=603884&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
Thu Dec 13 03:02:18 2007
@@ -351,9 +351,15 @@
                 // Producer flow control cannot be used, so we have do the flow
                 // control at the broker
                 // by blocking this thread until there is space available.
+                int count = 0;
                 while (!memoryUsage.waitForSpace(1000)) {
                     if (context.getStopping().get()) {
                         throw new IOException("Connection closed, send aborted.");
+                    }
+                    if (count > 2 && context.isInTransaction()) {
+                        count =0;
+                        int size = context.getTransaction().size();
+                        LOG.warn("Waiting for space to send  transacted message - transaction
elements = " + size + " need more space to commit. Message = " + message);
                     }
                 }
 

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transaction/Transaction.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transaction/Transaction.java?rev=603884&r1=603883&r2=603884&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transaction/Transaction.java
(original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transaction/Transaction.java
Thu Dec 13 03:02:18 2007
@@ -109,4 +109,8 @@
     public boolean isPrepared() {
         return getState() == PREPARED_STATE;
     }
+    
+    public int size() {
+        return synchronizations.size();
+    }
 }



Mime
View raw message