activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rajdav...@apache.org
Subject svn commit: r742876 - /activemq/trunk/activemq-core/src/main/java/org/apache/activemq/ActiveMQMessageConsumer.java
Date Tue, 10 Feb 2009 08:07:18 GMT
Author: rajdavies
Date: Tue Feb 10 08:07:16 2009
New Revision: 742876

URL: http://svn.apache.org/viewvc?rev=742876&view=rev
Log:
Fix for https://issues.apache.org/activemq/browse/AMQ-2100

Modified:
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/ActiveMQMessageConsumer.java

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/ActiveMQMessageConsumer.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/ActiveMQMessageConsumer.java?rev=742876&r1=742875&r2=742876&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/ActiveMQMessageConsumer.java
(original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/ActiveMQMessageConsumer.java
Tue Feb 10 08:07:16 2009
@@ -16,6 +16,7 @@
  */
 package org.apache.activemq;
 
+import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.Iterator;
 import java.util.LinkedList;
@@ -685,9 +686,14 @@
             if (session.isClientAcknowledge()) {
                 if (!this.info.isBrowser()) {
                     // rollback duplicates that aren't acknowledged
-                    for (MessageDispatch old : deliveredMessages) {
-                        session.connection.rollbackDuplicate(this, old.getMessage());
+                    List<MessageDispatch> tmp = null;
+                    synchronized (this.deliveredMessages) {
+                        tmp = new ArrayList<MessageDispatch>(this.deliveredMessages);
                     }
+                    for (MessageDispatch old : tmp) {
+                        this.session.connection.rollbackDuplicate(this, old.getMessage());
+                    }
+                    tmp.clear();
                 }
             }
             if (!session.isTransacted()) {



Mime
View raw message