Class HttpClusterPeerAccessor
- All Implemented Interfaces:
ClusterFanIn.PeerAccessor
ClusterFanIn.PeerAccessor that queries a peer's control-plane
PUT /mockserver/retrieve endpoint over HTTP using the JDK
HttpClient.
Every request carries fanInLocalOnly=true so the peer serves ONLY from its
own log and does not fan out again (infinite-recursion guard). Responses are parsed
with the same serializers the control plane uses, so the merged objects are identical
in shape to the local ones.
Authenticated clusters: when clusterFanInPeerAuthToken is set, every
peer query carries it verbatim as the control-plane Authorization header
(e.g. Bearer <jwt>), so a cluster with control-plane authentication
(bearer/JWT/OIDC) accepts the fan-in query instead of rejecting it with 401/403.
All nodes must share the same token / trust. With no token configured (the default)
no credential is sent — unchanged behaviour. mTLS client-certificate presentation
for peer queries remains a documented boundary (see docs/code/clustered-state.md).
-
Constructor Summary
ConstructorsConstructorDescriptionHttpClusterPeerAccessor(Configuration configuration, MockServerLogger mockServerLogger) -
Method Summary
Modifier and TypeMethodDescriptionretrieveRequestResponses(String peerBaseUrl, RequestDefinition filter) retrieveRequests(String peerBaseUrl, RequestDefinition filter)
-
Constructor Details
-
HttpClusterPeerAccessor
-
-
Method Details
-
retrieveRequests
public List<RequestDefinition> retrieveRequests(String peerBaseUrl, RequestDefinition filter) throws Exception - Specified by:
retrieveRequestsin interfaceClusterFanIn.PeerAccessor- Throws:
Exception
-
retrieveRequestResponses
public List<LogEventRequestAndResponse> retrieveRequestResponses(String peerBaseUrl, RequestDefinition filter) throws Exception - Specified by:
retrieveRequestResponsesin interfaceClusterFanIn.PeerAccessor- Throws:
Exception
-