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 bdb49bb30e..666c5c8369 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 @@ -174,10 +174,19 @@ public class TransportConfiguration implements Serializable { TransportConfiguration that = (TransportConfiguration) o; - if (!factoryClassName.equals(that.factoryClassName)) + if (!isSameHost(that)) { return false; + } + if (name != null ? !name.equals(that.name) : that.name != null) return false; + + return true; + } + + public boolean isSameHost(TransportConfiguration that) { + if (!factoryClassName.equals(that.factoryClassName)) + return false; if (params != null ? !params.equals(that.params) : that.params != null) return false; diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/ClientSessionFactoryImpl.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/ClientSessionFactoryImpl.java index acdf1e8e35..ed588ef364 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/ClientSessionFactoryImpl.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/ClientSessionFactoryImpl.java @@ -1269,7 +1269,7 @@ public class ClientSessionFactoryImpl implements ClientSessionFactoryInternal, C Pair connectorPair, boolean isLast) { // if it is our connector then set the live id used for failover - if (connectorPair.getA() != null && connectorPair.getA().equals(connectorConfig)) { + if (connectorPair.getA() != null && connectorPair.getA().isSameHost(connectorConfig)) { liveNodeID = nodeID; } serverLocator.notifyNodeUp(uniqueEventID, nodeID, backupGroupName, scaleDownGroupName, connectorPair, isLast); diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/TopologyMemberImpl.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/TopologyMemberImpl.java index f220457bff..7c11cd0a52 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/TopologyMemberImpl.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/TopologyMemberImpl.java @@ -107,7 +107,7 @@ public final class TopologyMemberImpl implements TopologyMember { } public boolean isMember(TransportConfiguration configuration) { - if (getConnector().getA() != null && getConnector().getA().equals(configuration) || getConnector().getB() != null && getConnector().getB().equals(configuration)) { + if (getConnector().getA() != null && getConnector().getA().isSameHost(configuration) || getConnector().getB() != null && getConnector().getB().isSameHost(configuration)) { return true; } else {