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.
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
-
Method Details
-
dispatch
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:
trueif the send was accepted by the transport (NOT a delivery ack);falseif the peer is unreachable, backpressured, or otherwise rejected.
-