activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cshan...@apache.org
Subject activemq git commit: https://issues.apache.org/jira/browse/AMQ-6366
Date Wed, 20 Jul 2016 12:33:58 GMT
Repository: activemq
Updated Branches:
  refs/heads/master e05db7cb5 -> 9f7d70ba0


https://issues.apache.org/jira/browse/AMQ-6366

Need to make sure that the durableDestinations set on the duplex bridge
are only topics


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

Branch: refs/heads/master
Commit: 9f7d70ba0d8f0262c76844954b274786e3d7545f
Parents: e05db7c
Author: Christopher L. Shannon (cshannon) <christopher.l.shannon@gmail.com>
Authored: Wed Jul 20 08:33:15 2016 -0400
Committer: Christopher L. Shannon (cshannon) <christopher.l.shannon@gmail.com>
Committed: Wed Jul 20 08:33:45 2016 -0400

----------------------------------------------------------------------
 .../activemq/broker/TransportConnection.java       |  8 ++++----
 .../apache/activemq/network/NetworkConnector.java  | 17 +++++++++++------
 2 files changed, 15 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq/blob/9f7d70ba/activemq-broker/src/main/java/org/apache/activemq/broker/TransportConnection.java
----------------------------------------------------------------------
diff --git a/activemq-broker/src/main/java/org/apache/activemq/broker/TransportConnection.java
b/activemq-broker/src/main/java/org/apache/activemq/broker/TransportConnection.java
index 8019c12..92133e8 100755
--- a/activemq-broker/src/main/java/org/apache/activemq/broker/TransportConnection.java
+++ b/activemq-broker/src/main/java/org/apache/activemq/broker/TransportConnection.java
@@ -81,6 +81,7 @@ import org.apache.activemq.network.DemandForwardingBridge;
 import org.apache.activemq.network.MBeanNetworkListener;
 import org.apache.activemq.network.NetworkBridgeConfiguration;
 import org.apache.activemq.network.NetworkBridgeFactory;
+import org.apache.activemq.network.NetworkConnector;
 import org.apache.activemq.security.MessageAuthorizationPolicy;
 import org.apache.activemq.state.CommandVisitor;
 import org.apache.activemq.state.ConnectionState;
@@ -1420,11 +1421,10 @@ public class TransportConnection implements Connection, Task, CommandVisitor
{
                 listener.setCreatedByDuplex(true);
                 duplexBridge = NetworkBridgeFactory.createBridge(config, localTransport,
remoteBridgeTransport, listener);
                 duplexBridge.setBrokerService(brokerService);
-                Set<ActiveMQDestination> durableDestinations = broker.getDurableDestinations();
                 //Need to set durableDestinations to properly restart subs when dynamicOnly=false
-                if (durableDestinations != null) {
-                    duplexBridge.setDurableDestinations(broker.getDurableDestinations().toArray(new
ActiveMQDestination[0]));
-                }
+                duplexBridge.setDurableDestinations(NetworkConnector.getDurableTopicDestinations(
+                        broker.getDurableDestinations()));
+
                 // now turn duplex off this side
                 info.setDuplexConnection(false);
                 duplexBridge.setCreatedByDuplex(true);

http://git-wip-us.apache.org/repos/asf/activemq/blob/9f7d70ba/activemq-broker/src/main/java/org/apache/activemq/network/NetworkConnector.java
----------------------------------------------------------------------
diff --git a/activemq-broker/src/main/java/org/apache/activemq/network/NetworkConnector.java
b/activemq-broker/src/main/java/org/apache/activemq/network/NetworkConnector.java
index b37dc0f..5faf94c 100644
--- a/activemq-broker/src/main/java/org/apache/activemq/network/NetworkConnector.java
+++ b/activemq-broker/src/main/java/org/apache/activemq/network/NetworkConnector.java
@@ -135,6 +135,15 @@ public abstract class NetworkConnector extends NetworkBridgeConfiguration
implem
         destsList = getStaticallyIncludedDestinations();
         dests = destsList.toArray(new ActiveMQDestination[destsList.size()]);
         result.setStaticallyIncludedDestinations(dests);
+        result.setDurableDestinations(getDurableTopicDestinations(durableDestinations));
+        return result;
+    }
+
+    protected Transport createLocalTransport() throws Exception {
+        return TransportFactory.connect(localURI);
+    }
+
+    public static ActiveMQDestination[] getDurableTopicDestinations(final Set<ActiveMQDestination>
durableDestinations) {
         if (durableDestinations != null) {
 
             HashSet<ActiveMQDestination> topics = new HashSet<ActiveMQDestination>();
@@ -146,13 +155,9 @@ public abstract class NetworkConnector extends NetworkBridgeConfiguration
implem
 
             ActiveMQDestination[] dest = new ActiveMQDestination[topics.size()];
             dest = topics.toArray(dest);
-            result.setDurableDestinations(dest);
+            return dest;
         }
-        return result;
-    }
-
-    protected Transport createLocalTransport() throws Exception {
-        return TransportFactory.connect(localURI);
+        return null;
     }
 
     @Override


Mime
View raw message