Class AnyNodeLocatorForReplication

java.lang.Object
org.apache.activemq.artemis.core.server.NodeLocator
org.apache.activemq.artemis.core.server.impl.AnyNodeLocatorForReplication
All Implemented Interfaces:
ClusterTopologyListener

public class AnyNodeLocatorForReplication extends NodeLocator
This implementation looks for any available node, once tried with no success it is marked as tried and the next available is used.
  • Constructor Details

  • Method Details

    • locateNode

      public void locateNode() throws ActiveMQException
      Description copied from class: NodeLocator
      Locates a server in a cluster
      Specified by:
      locateNode in class NodeLocator
      Throws:
      ActiveMQException
    • locateNode

      public void locateNode(long timeout) throws ActiveMQException
      Description copied from class: NodeLocator
      Locates a server in a cluster with a timeout
      Specified by:
      locateNode in class NodeLocator
      Throws:
      ActiveMQException
    • nodeUP

      public void nodeUP(TopologyMember topologyMember, boolean last)
      Description copied from interface: ClusterTopologyListener
      Triggered when a node joins the cluster.
      last - if the whole cluster topology is being transmitted (after adding the listener to the cluster connection) this parameter will be true for the last topology member.
    • nodeDown

      public void nodeDown(long eventUID, String nodeID)
      if a node goes down we try all the connectors again as one may now be available for replication

      TODO: there will be a better way to do this by finding which nodes backup has gone down.

      nodeID - the id of the node leaving the cluster
    • getNodeID

      public String getNodeID()
      Description copied from class: NodeLocator
      Returns the node id for the current connector.
      Specified by:
      getNodeID in class NodeLocator
      Returns:
      the node id for the current connector
    • getPrimaryConfiguration

      public Pair<TransportConfiguration,TransportConfiguration> getPrimaryConfiguration()
      Description copied from class: NodeLocator
      Returns the current connector.
      Specified by:
      getPrimaryConfiguration in class NodeLocator
      Returns:
      the current connector
    • notifyRegistrationFailed

      public void notifyRegistrationFailed(boolean alreadyReplicating)
      Description copied from class: NodeLocator
      tells the locator the current connector has failed.
      Overrides:
      notifyRegistrationFailed in class NodeLocator