When recovering durable subscriptions - ensure they are recovered only once

git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@628778 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Robert Davies 2008-02-18 15:13:12 +00:00
parent 4a8ade0fae
commit 900c9af498
1 changed files with 3 additions and 2 deletions

View File

@ -19,6 +19,7 @@ package org.apache.activemq.store.kahadaptor;
import java.io.File;
import java.io.IOException;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;
@ -253,8 +254,8 @@ public class KahaReferenceStoreAdapter extends KahaPersistenceAdapter implements
*/
public void recoverState() throws IOException {
for (Iterator<SubscriptionInfo> i = durableSubscribers.iterator(); i.hasNext();) {
SubscriptionInfo info = i.next();
Set<SubscriptionInfo> set = new HashSet<SubscriptionInfo>(this.durableSubscribers);
for (SubscriptionInfo info:set) {
LOG.info("Recovering subscriber state for durable subscriber: " + info);
TopicReferenceStore ts = createTopicReferenceStore((ActiveMQTopic)info.getDestination());
ts.addSubsciption(info, false);