Class HttpClusterPeerAccessor

java.lang.Object
org.mockserver.cluster.HttpClusterPeerAccessor
All Implemented Interfaces:
ClusterFanIn.PeerAccessor

public class HttpClusterPeerAccessor extends Object implements ClusterFanIn.PeerAccessor
Default 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).