activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From clebertsuco...@apache.org
Subject activemq-artemis git commit: ARTEMIS-151 Fixing tests
Date Wed, 07 Oct 2015 23:49:44 GMT
Repository: activemq-artemis
Updated Branches:
  refs/heads/master 9d3866471 -> c3448e702


ARTEMIS-151 Fixing tests


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

Branch: refs/heads/master
Commit: c3448e7029e29a2aede31ea0a1abefaa38fe5b42
Parents: 9d38664
Author: Clebert Suconic <clebertsuconic@apache.org>
Authored: Wed Oct 7 18:48:26 2015 -0400
Committer: Clebert Suconic <clebertsuconic@apache.org>
Committed: Wed Oct 7 18:48:26 2015 -0400

----------------------------------------------------------------------
 .../artemis/api/core/TransportConfiguration.java         |  4 ++++
 .../core/server/cluster/impl/ClusterConnectionImpl.java  | 11 +++++++++--
 2 files changed, 13 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/c3448e70/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/TransportConfiguration.java
----------------------------------------------------------------------
diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/TransportConfiguration.java
b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/TransportConfiguration.java
index 5dd7eda..bdb49bb 100644
--- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/TransportConfiguration.java
+++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/TransportConfiguration.java
@@ -105,6 +105,10 @@ public class TransportConfiguration implements Serializable {
       this.name = name;
    }
 
+   public TransportConfiguration newTransportConfig(String newName) {
+      return new TransportConfiguration(factoryClassName,  params, newName);
+   }
+
    /**
     * Creates a TransportConfiguration providing the class name of the {@link org.apache.activemq.artemis.spi.core.remoting.ConnectorFactory}
     * and any parameters needed.

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/c3448e70/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/impl/ClusterConnectionImpl.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/impl/ClusterConnectionImpl.java
b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/impl/ClusterConnectionImpl.java
index e42f46b..e6b4bf6 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/impl/ClusterConnectionImpl.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/impl/ClusterConnectionImpl.java
@@ -73,6 +73,11 @@ import org.apache.activemq.artemis.utils.TypedProperties;
 
 public final class ClusterConnectionImpl implements ClusterConnection, AfterConnectInternalListener
{
 
+   /** When getting member on node-up and down we have to remove the name from the transport
config
+    *  as the setting we build here doesn't need to consider the name, so use the same name
on all
+    *  the instances.  */
+   private static final String TRANSPORT_CONFIG_NAME = "topology-member";
+
    private static final boolean isTrace = ActiveMQServerLogger.LOGGER.isTraceEnabled();
 
    private final ExecutorFactory executorFactory;
@@ -258,7 +263,9 @@ public final class ClusterConnectionImpl implements ClusterConnection,
AfterConn
          // a cluster connection will connect to other nodes only if they are directly connected
          // through a static list of connectors or broadcasting using UDP.
          if (allowDirectConnectionsOnly) {
-            allowableConnections.addAll(Arrays.asList(staticTranspConfigs));
+            for (TransportConfiguration configuration : staticTranspConfigs) {
+               allowableConnections.add(configuration.newTransportConfig(TRANSPORT_CONFIG_NAME));
+            }
          }
       }
 
@@ -638,7 +645,7 @@ public final class ClusterConnectionImpl implements ClusterConnection,
AfterConn
       }
 
       // if the node is more than 1 hop away, we do not create a bridge for direct cluster
connection
-      if (allowDirectConnectionsOnly && !allowableConnections.contains(topologyMember.getLive()))
{
+      if (allowDirectConnectionsOnly && !allowableConnections.contains(topologyMember.getLive().newTransportConfig(TRANSPORT_CONFIG_NAME)))
{
          return;
       }
 


Mime
View raw message