Return-Path: X-Original-To: apmail-activemq-commits-archive@www.apache.org Delivered-To: apmail-activemq-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 1D052F1C1 for ; Mon, 26 May 2014 09:07:29 +0000 (UTC) Received: (qmail 3314 invoked by uid 500); 26 May 2014 09:07:29 -0000 Delivered-To: apmail-activemq-commits-archive@activemq.apache.org Received: (qmail 3218 invoked by uid 500); 26 May 2014 09:07:28 -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 3131 invoked by uid 99); 26 May 2014 09:07:28 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 26 May 2014 09:07:28 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 857F19A5246; Mon, 26 May 2014 09:07:28 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: dejanb@apache.org To: commits@activemq.apache.org Date: Mon, 26 May 2014 09:07:33 -0000 Message-Id: In-Reply-To: <07fc2c10b1da4c019cda34d633c40986@git.apache.org> References: <07fc2c10b1da4c019cda34d633c40986@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [06/13] git commit: Fixed AMQ-5160, changed DurableTopicSubscription to only recover retroactive messages for retroactive topics or consumers Fixed AMQ-5160, changed DurableTopicSubscription to only recover retroactive messages for retroactive topics or consumers Project: http://git-wip-us.apache.org/repos/asf/activemq/repo Commit: http://git-wip-us.apache.org/repos/asf/activemq/commit/78950ec5 Tree: http://git-wip-us.apache.org/repos/asf/activemq/tree/78950ec5 Diff: http://git-wip-us.apache.org/repos/asf/activemq/diff/78950ec5 Branch: refs/heads/trunk Commit: 78950ec596377fc3417fc99ba67b03ec10e89cf9 Parents: 70f7c58 Author: Dhiraj Bokde Authored: Tue May 13 12:14:21 2014 -0700 Committer: Dejan Bosanac Committed: Mon May 26 11:07:19 2014 +0200 ---------------------------------------------------------------------- .../activemq/broker/region/DurableTopicSubscription.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/activemq/blob/78950ec5/activemq-broker/src/main/java/org/apache/activemq/broker/region/DurableTopicSubscription.java ---------------------------------------------------------------------- diff --git a/activemq-broker/src/main/java/org/apache/activemq/broker/region/DurableTopicSubscription.java b/activemq-broker/src/main/java/org/apache/activemq/broker/region/DurableTopicSubscription.java index 6501e58..c82e6ef 100755 --- a/activemq-broker/src/main/java/org/apache/activemq/broker/region/DurableTopicSubscription.java +++ b/activemq-broker/src/main/java/org/apache/activemq/broker/region/DurableTopicSubscription.java @@ -120,8 +120,9 @@ public class DurableTopicSubscription extends PrefetchSubscription implements Us if (active.get() || keepDurableSubsActive) { Topic topic = (Topic) destination; topic.activate(context, this); - // always use the recovery policy - topic.recoverRetroactiveMessages(context, this); + if (topic.isAlwaysRetroactive() || info.isRetroactive()) { + topic.recoverRetroactiveMessages(context, this); + } this.enqueueCounter += pending.size(); } else if (destination.getMessageStore() != null) { TopicMessageStore store = (TopicMessageStore) destination.getMessageStore(); @@ -166,10 +167,12 @@ public class DurableTopicSubscription extends PrefetchSubscription implements Us pending.setMaxAuditDepth(getMaxAuditDepth()); pending.setMaxProducersToAudit(getMaxProducersToAudit()); pending.start(); - // always use the recovery policy. + // use recovery policy for retroactive topics and consumers for (Destination destination : durableDestinations.values()) { Topic topic = (Topic) destination; - topic.recoverRetroactiveMessages(context, this); + if (topic.isAlwaysRetroactive() || info.isRetroactive()) { + topic.recoverRetroactiveMessages(context, this); + } } } }