git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@742876 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Robert Davies 2009-02-10 08:07:16 +00:00
parent 504bcf0596
commit 586ea12d1e
1 changed files with 8 additions and 2 deletions

View File

@ -16,6 +16,7 @@
*/ */
package org.apache.activemq; package org.apache.activemq;
import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.Iterator; import java.util.Iterator;
import java.util.LinkedList; import java.util.LinkedList;
@ -685,9 +686,14 @@ public class ActiveMQMessageConsumer implements MessageAvailableConsumer, StatsC
if (session.isClientAcknowledge()) { if (session.isClientAcknowledge()) {
if (!this.info.isBrowser()) { if (!this.info.isBrowser()) {
// rollback duplicates that aren't acknowledged // rollback duplicates that aren't acknowledged
for (MessageDispatch old : deliveredMessages) { List<MessageDispatch> tmp = null;
session.connection.rollbackDuplicate(this, old.getMessage()); 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()) { if (!session.isTransacted()) {