activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gtu...@apache.org
Subject [1/2] git commit: https://issues.apache.org/jira/browse/AMQ-2327 - fix regression in org.apache.activemq.usecases.TwoBrokerTopicSendReceiveLotsOfMessagesUsingTcpTest - statically included and dynaically included topic of same name. Need to conduit static
Date Tue, 01 Oct 2013 14:22:36 GMT
Updated Branches:
  refs/heads/trunk 9883ecffc -> a80a1857d


https://issues.apache.org/jira/browse/AMQ-2327 - fix regression in org.apache.activemq.usecases.TwoBrokerTopicSendReceiveLotsOfMessagesUsingTcpTest
- statically included and dynaically included topic of same name. Need to conduit statically
included (local networkSubs)


Project: http://git-wip-us.apache.org/repos/asf/activemq/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq/commit/a80a1857
Tree: http://git-wip-us.apache.org/repos/asf/activemq/tree/a80a1857
Diff: http://git-wip-us.apache.org/repos/asf/activemq/diff/a80a1857

Branch: refs/heads/trunk
Commit: a80a1857d0ca86b3253f92c05134c31e8bb1e913
Parents: f609c50
Author: gtully <gary.tully@gmail.com>
Authored: Tue Oct 1 15:20:41 2013 +0100
Committer: gtully <gary.tully@gmail.com>
Committed: Tue Oct 1 15:21:21 2013 +0100

----------------------------------------------------------------------
 .../java/org/apache/activemq/network/ConduitBridge.java     | 8 +++++++-
 .../activemq/network/DemandForwardingBridgeSupport.java     | 1 +
 .../org/apache/activemq/network/DemandSubscription.java     | 9 +++++++++
 3 files changed, 17 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq/blob/a80a1857/activemq-broker/src/main/java/org/apache/activemq/network/ConduitBridge.java
----------------------------------------------------------------------
diff --git a/activemq-broker/src/main/java/org/apache/activemq/network/ConduitBridge.java
b/activemq-broker/src/main/java/org/apache/activemq/network/ConduitBridge.java
index b2bb5c4..10df1f9 100644
--- a/activemq-broker/src/main/java/org/apache/activemq/network/ConduitBridge.java
+++ b/activemq-broker/src/main/java/org/apache/activemq/network/ConduitBridge.java
@@ -64,7 +64,7 @@ public class ConduitBridge extends DemandForwardingBridge {
 
         for (DemandSubscription ds : subscriptionMapByLocalId.values()) {
             DestinationFilter filter = DestinationFilter.parseFilter(ds.getLocalInfo().getDestination());
-            if (!ds.getRemoteInfo().isNetworkSubscription() && filter.matches(info.getDestination()))
{
+            if (canConduit(ds) && filter.matches(info.getDestination())) {
                 LOG.debug("{} {} with ids {} matched (add interest) {}", new Object[]{
                         configuration.getBrokerName(), info, info.getNetworkConsumerIds(),
ds
                 });
@@ -81,6 +81,12 @@ public class ConduitBridge extends DemandForwardingBridge {
         return matched;
     }
 
+    // we want to conduit statically included consumers which are local networkSubs
+    // but we don't want to conduit remote network subs i.e. (proxy proxy) consumers
+    private boolean canConduit(DemandSubscription ds) {
+        return ds.isStaticallyIncluded() || !ds.getRemoteInfo().isNetworkSubscription();
+    }
+
     @Override
     protected void removeDemandSubscription(ConsumerId id) throws IOException {
         List<DemandSubscription> tmpList = new ArrayList<DemandSubscription>();

http://git-wip-us.apache.org/repos/asf/activemq/blob/a80a1857/activemq-broker/src/main/java/org/apache/activemq/network/DemandForwardingBridgeSupport.java
----------------------------------------------------------------------
diff --git a/activemq-broker/src/main/java/org/apache/activemq/network/DemandForwardingBridgeSupport.java
b/activemq-broker/src/main/java/org/apache/activemq/network/DemandForwardingBridgeSupport.java
index 6d7b7df..ea61472 100644
--- a/activemq-broker/src/main/java/org/apache/activemq/network/DemandForwardingBridgeSupport.java
+++ b/activemq-broker/src/main/java/org/apache/activemq/network/DemandForwardingBridgeSupport.java
@@ -1103,6 +1103,7 @@ public abstract class DemandForwardingBridgeSupport implements NetworkBridge,
Br
         if (dests != null) {
             for (ActiveMQDestination dest : dests) {
                 DemandSubscription sub = createDemandSubscription(dest);
+                sub.setStaticallyIncluded(true);
                 try {
                     addSubscription(sub);
                 } catch (IOException e) {

http://git-wip-us.apache.org/repos/asf/activemq/blob/a80a1857/activemq-broker/src/main/java/org/apache/activemq/network/DemandSubscription.java
----------------------------------------------------------------------
diff --git a/activemq-broker/src/main/java/org/apache/activemq/network/DemandSubscription.java
b/activemq-broker/src/main/java/org/apache/activemq/network/DemandSubscription.java
index e67565b..b53646a 100644
--- a/activemq-broker/src/main/java/org/apache/activemq/network/DemandSubscription.java
+++ b/activemq-broker/src/main/java/org/apache/activemq/network/DemandSubscription.java
@@ -44,6 +44,7 @@ public class DemandSubscription {
     private SubscriptionInfo localDurableSubscriber;
 
     private NetworkBridgeFilter networkBridgeFilter;
+    private boolean staticallyIncluded;
 
     DemandSubscription(ConsumerInfo info) {
         remoteInfo = info;
@@ -155,4 +156,12 @@ public class DemandSubscription {
     public void setLocalDurableSubscriber(SubscriptionInfo localDurableSubscriber) {
         this.localDurableSubscriber = localDurableSubscriber;
     }
+
+    public boolean isStaticallyIncluded() {
+        return staticallyIncluded;
+    }
+
+    public void setStaticallyIncluded(boolean staticallyIncluded) {
+        this.staticallyIncluded = staticallyIncluded;
+    }
 }


Mime
View raw message