From 8a524d52ef868f0a5e16fcda352f084d92719636 Mon Sep 17 00:00:00 2001 From: "Timothy A. Bish" Date: Tue, 4 Jun 2013 15:44:50 +0000 Subject: [PATCH] Fix for: https://issues.apache.org/jira/browse/AMQ-4571 accounts for nested Destination filters. git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@1489485 13f79535-47bb-0310-9956-ffa450edef68 --- .../apache/activemq/broker/region/DestinationFilter.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/activemq-broker/src/main/java/org/apache/activemq/broker/region/DestinationFilter.java b/activemq-broker/src/main/java/org/apache/activemq/broker/region/DestinationFilter.java index 1b1d3be78b..a7613ef2d1 100644 --- a/activemq-broker/src/main/java/org/apache/activemq/broker/region/DestinationFilter.java +++ b/activemq-broker/src/main/java/org/apache/activemq/broker/region/DestinationFilter.java @@ -389,8 +389,13 @@ public class DestinationFilter implements Destination { } public void deleteSubscription(ConnectionContext context, SubscriptionKey key) throws Exception { - if (next instanceof Topic) { - ((Topic) next).deleteSubscription(context, key); + Destination target = next; + while (target instanceof DestinationFilter) { + target = ((DestinationFilter) target).next; + } + if (target instanceof Topic) { + Topic topic = (Topic)target; + topic.deleteSubscription(context, key); } } }