Interface PeerMessageDispatch

Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface PeerMessageDispatch
Narrow dispatch interface used by the 2PC coordinator and participants to send cross-node messages without depending on the concrete TcpServer.

Tests substitute a lambda or a Mockito mock — the concrete network path is a loom-server internal and fails HARD SAFETY RAIL 4 ("no mocks of concrete RaftNode/RaftGroupManager/KryoSerializer/JPA repos").

Implementations must be thread-safe; the 2PC protocol scatters messages from a scheduled executor and from state-machine apply threads concurrently.

  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    dispatch(@NonNull String targetNodeId, @NonNull Message message)
    Send a message to a specific peer node.
  • Method Details

    • dispatch

      boolean dispatch(@NonNull String targetNodeId, @NonNull Message message)
      Send a message to a specific peer node.
      Parameters:
      targetNodeId - the receiving node's Raft id (non-null)
      message - the wire message (non-null)
      Returns:
      true if the send was accepted by the transport (NOT a delivery ack); false if the peer is unreachable, backpressured, or otherwise rejected.