Return-Path: Delivered-To: apmail-activemq-commits-archive@www.apache.org Received: (qmail 96885 invoked from network); 16 Jun 2008 06:30:47 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 16 Jun 2008 06:30:47 -0000 Received: (qmail 54084 invoked by uid 500); 16 Jun 2008 06:30:49 -0000 Delivered-To: apmail-activemq-commits-archive@activemq.apache.org Received: (qmail 54065 invoked by uid 500); 16 Jun 2008 06:30:49 -0000 Mailing-List: contact commits-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@activemq.apache.org Delivered-To: mailing list commits@activemq.apache.org Received: (qmail 54056 invoked by uid 99); 16 Jun 2008 06:30:48 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 15 Jun 2008 23:30:48 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 16 Jun 2008 06:30:07 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 0AEC22388A06; Sun, 15 Jun 2008 23:30:26 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r668061 - /activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/cursors/StoreDurableSubscriberCursor.java Date: Mon, 16 Jun 2008 06:30:25 -0000 To: commits@activemq.apache.org From: rajdavies@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20080616063026.0AEC22388A06@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: rajdavies Date: Sun Jun 15 23:30:25 2008 New Revision: 668061 URL: http://svn.apache.org/viewvc?rev=668061&view=rev Log: Fix for https://issues.apache.org/activemq/browse/AMQ-1799 Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/cursors/StoreDurableSubscriberCursor.java Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/cursors/StoreDurableSubscriberCursor.java URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/cursors/StoreDurableSubscriberCursor.java?rev=668061&r1=668060&r2=668061&view=diff ============================================================================== --- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/cursors/StoreDurableSubscriberCursor.java (original) +++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/cursors/StoreDurableSubscriberCursor.java Sun Jun 15 23:30:25 2008 @@ -20,9 +20,9 @@ import java.util.Collections; import java.util.HashMap; import java.util.Iterator; -import java.util.LinkedList; import java.util.List; import java.util.Map; +import java.util.concurrent.CopyOnWriteArrayList; import org.apache.activemq.advisory.AdvisorySupport; import org.apache.activemq.broker.Broker; import org.apache.activemq.broker.ConnectionContext; @@ -47,7 +47,7 @@ private String clientId; private String subscriberName; private Map topics = new HashMap(); - private LinkedList storePrefetches = new LinkedList(); + private List storePrefetches = new CopyOnWriteArrayList(); private boolean started; private PendingMessageCursor nonPersistent; private PendingMessageCursor currentCursor; @@ -322,7 +322,10 @@ } } // round-robin - storePrefetches.addLast(storePrefetches.removeFirst()); + if (storePrefetches.size()>1) { + PendingMessageCursor first = storePrefetches.remove(0); + storePrefetches.add(first); + } } return currentCursor; }