activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gtu...@apache.org
Subject svn commit: r898281 - /activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/PrefetchSubscription.java
Date Tue, 12 Jan 2010 11:21:29 GMT
Author: gtully
Date: Tue Jan 12 11:21:28 2010
New Revision: 898281

URL: http://svn.apache.org/viewvc?rev=898281&view=rev
Log:
resolve intermittent ZeroPrefetchConsumerTest failure - prefetch excension decrement needs
to be conditional on prefecth=0, relates to changes to prefetchExtension for https://issues.apache.org/activemq/browse/AMQ-2560

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

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/PrefetchSubscription.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/PrefetchSubscription.java?rev=898281&r1=898280&r2=898281&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/PrefetchSubscription.java
(original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/PrefetchSubscription.java
Tue Jan 12 11:21:28 2010
@@ -249,6 +249,7 @@
                         index++;
                         acknowledge(context, ack, node);
                         if (ack.getLastMessageId().equals(messageId)) {
+                            
                             if (context.isInTransaction()) {
                                 // extend prefetch window only if not a pulling
                                 // consumer
@@ -256,6 +257,11 @@
                                     prefetchExtension = Math.max(
                                             prefetchExtension, index );
                                 }
+                            } else {
+                                // contract prefetch if dispatch required a pull
+                                if (getPrefetchSize() == 0) {
+                                    prefetchExtension = Math.max(0, prefetchExtension - index);
+                                }
                             }
                             destination = node.getRegionDestination();
                             callDispatchMatched = true;



Mime
View raw message