Search in sources :

Example 1 with ClusterIdAwareMessage

use of org.neo4j.causalclustering.core.consensus.RaftMessages.ClusterIdAwareMessage in project neo4j by neo4j.

the class RaftOutbound method send.

@Override
public void send(MemberId to, RaftMessage message) {
    Optional<ClusterId> clusterId = clusterIdentity.get();
    if (!clusterId.isPresent()) {
        log.warn("Attempting to send a message before bound to a cluster");
        return;
    }
    Optional<CoreServerInfo> coreServerInfo = coreTopologyService.coreServers().find(to);
    if (coreServerInfo.isPresent()) {
        outbound.send(coreServerInfo.get().getRaftServer(), new ClusterIdAwareMessage(clusterId.get(), message));
    } else {
        unknownAddressMonitor.logAttemptToSendToMemberWithNoKnownAddress(to);
    }
}
Also used : ClusterIdAwareMessage(org.neo4j.causalclustering.core.consensus.RaftMessages.ClusterIdAwareMessage) ClusterId(org.neo4j.causalclustering.identity.ClusterId) CoreServerInfo(org.neo4j.causalclustering.discovery.CoreServerInfo)

Aggregations

ClusterIdAwareMessage (org.neo4j.causalclustering.core.consensus.RaftMessages.ClusterIdAwareMessage)1 CoreServerInfo (org.neo4j.causalclustering.discovery.CoreServerInfo)1 ClusterId (org.neo4j.causalclustering.identity.ClusterId)1