activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chir...@apache.org
Subject svn commit: r382439 - /incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/PrefetchSubscription.java
Date Thu, 02 Mar 2006 16:36:42 GMT
Author: chirino
Date: Thu Mar  2 08:36:42 2006
New Revision: 382439

URL: http://svn.apache.org/viewcvs?rev=382439&view=rev
Log:
Fix for http://jira.activemq.org/jira/browse/AMQ-578

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

Modified: incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/PrefetchSubscription.java
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/PrefetchSubscription.java?rev=382439&r1=382438&r2=382439&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/PrefetchSubscription.java
(original)
+++ incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/PrefetchSubscription.java
Thu Mar  2 08:36:42 2006
@@ -107,24 +107,8 @@
                         context.getTransaction().addSynchronization(new Synchronization(){
                             public void afterCommit() throws Throwable{
                                 synchronized(PrefetchSubscription.this){
-                                    // Now that we are committed, we can remove the nodes.
-                                    boolean inAckRange=false;
-                                    int index=0;
-                                    for(Iterator iter=dispatched.iterator();iter.hasNext();){
-                                        final MessageReference node=(MessageReference) iter.next();
-                                        MessageId messageId=node.getMessageId();
-                                        if(ack.getFirstMessageId()==null||ack.getFirstMessageId().equals(messageId)){
-                                            inAckRange=true;
-                                        }
-                                        if(inAckRange){
-                                            index++;
-                                            iter.remove();
-                                            if(ack.getLastMessageId().equals(messageId)){
-                                                delivered=Math.max(0,delivered-(index+1));
-                                                return;
-                                            }
-                                        }
-                                    }
+                                    dispatched.remove(node);
+                                    delivered--;
                                 }
                             }
                         });



Mime
View raw message