All Classes and Interfaces
Class
Description
Outbound handler that adds an
Alt-Svc header to responses served
over the TCP (HTTP/1.1 and HTTP/2) paths when HTTP/3 is enabled.Immutable model of the AsyncAPI AMQP 0.9.1 channel binding
(
channels.<name>.bindings.amqp), carrying the publish-time routing
information that AmqpMessagePublisher
needs to deliver a message to a RabbitMQ broker.The two shapes an AMQP channel can take, per the AsyncAPI
is field.A
MessagePublisher that delivers messages to an AMQP 0.9.1 broker
(RabbitMQ) using the official com.rabbitmq:amqp-client library.A
MessageSubscriber that consumes from an AMQP 0.9.1 broker (RabbitMQ)
using the official com.rabbitmq:amqp-client library, the consumer-side
counterpart of AmqpMessagePublisher.Represents a single channel from an AsyncAPI specification,
with its name, zero or more message payload examples, and
optional publish-time bindings (MQTT qos/retain, Kafka key).
Implementation of
AsyncApiControlPlane that lives in the mockserver-async
module and is registered into the core's AsyncApiControlPlaneRegistry
at server startup.Generates HTTP mock
Expectations from a parsed AsyncAPI spec so that the
example messages each channel describes can be served over plain HTTP — without
standing up a live Kafka / MQTT / AMQP broker.Represents a single message definition within an AsyncAPI channel.
Orchestrates publishing of example messages derived from an AsyncAPI spec
to a message broker via a
MessagePublisher.Parses an AsyncAPI 2.x or 3.x document (JSON or YAML) into an
AsyncApiSpec.Validates JSON payloads against an AsyncAPI channel's JSON Schema definition,
reusing
JsonSchemaValidator from mockserver-core (which uses the
com.networknt:json-schema-validator library under the hood).Result of a schema validation.
A parsed AsyncAPI specification containing the channels and their message definitions.
Converts message payloads between JSON text and Avro binary using Apache Avro's
GenericDatum reader/writer — no code generation and no Confluent serde
stack required.Sizes the buffer each read of an accepted connection is given: as the channel's own allocator does (adaptive,
following recent reads down to 64 bytes) until the connection is found to be binary, then
BinaryAwareRecvByteBufAllocator.BINARY_READ_SIZE for every read, so that a binary message is not cut by a buffer that has followed
small messages down.Cuts a binary connection into the messages of a protocol, as a client sends them, so that each is matched,
forwarded and logged as one message however it was read.
Joins what one read loop delivers on a binary connection into one message, so that a message is not cut where a
read buffer filled or where TLS handed over part of what it had decrypted.
One binary client connection's single upstream connection, and the bytes relayed between the two as they arrive.
A thread-safe, bounded FIFO store for
RecordedMessage instances.Logs a client's failed TLS handshake, on TCP and on HTTP/3: at
WARN for the first failure from a client
address on a transport, with a hint about its likely cause, and at DEBUG for each later one, so a client
that retries, or a scan, does not fill the log.A composite
TransparentProxyHandler.OriginalDestinationResolver that tries
an ordered chain of resolution strategies and returns the first non-null result.Encoder/decoder for the Confluent Schema Registry wire format used by
Kafka Avro/Protobuf messages.
The result of decoding a wire-format message: the embedded schema id and the
remaining serialized payload bytes.
Copies the connection-scoped channel attributes from a parent channel onto a child channel.
Resolves the original destination of a transparently intercepted TCP connection
by reading the Linux conntrack table (
/proc/net/nf_conntrack).The checks every control-plane WebSocket upgrade (
/_mockserver_ui_websocket and
/_mockserver_callback_websocket) must pass before it is upgraded: the browser
Origin must be allowed by CORSOriginPolicy, and the control-plane
authentication, when configured, must allow the request.The caller of an admitted upgrade: whether control-plane authentication admitted it and, when
its authentication handler can name one, the caller's identity.
Shortens the bodies the dashboard sends in its live updates.
Renders one log entry's bodies for the dashboard: a body already cut for an earlier row under the same
variant (with redaction on, its redacted rendering) comes back as that cut text without being decoded again.
What capping one log entry's messages found: each cut copy's full body length, and roughly how many
characters the entry adds to an update.
Shared data-plane (mocked endpoint) authentication gate used by every Netty data-plane dispatch
path —
HttpRequestHandler (HTTP/1.1, HTTP/2, gRPC-over-h2) and
Http3MockServerHandler (HTTP/3 / QUIC, including gRPC-over-HTTP/3).Resolves the original destination of a transparently intercepted TCP connection
by consulting the
DnsIntentRegistry — a record of hostname-to-IP answers
that MockServer's DNS server has handed out.Thrown at start-up when
dnsEnabled is true and the DNS server could not be started on dnsPort,
so that MockServer does not run without a listener it was configured to serve.Inspects the incoming Netty HttpRequest (headers only) and, when a matching expectation
is configured with
respondBeforeBody=true, dispatches the response and closes the
connection before HttpObjectAggregator buffers the request body.Response writer for the early-dispatch path.
Resolves the original destination of a transparently intercepted TCP connection
by reading a pinned BPF hash map populated by an external eBPF program.
The proxy client's side of the CONNECT/SOCKS relay's HTTP/2 tunnel, handing each request on once, with its whole body.
Leaves Netty's
x-http2- extension headers (HttpConversionUtil.ExtensionHeaderNames) out of every
header block an HttpToHttp2ConnectionHandler sends.Per-stream handler for serving gRPC Server Reflection interactively over the
bidirectional-streaming multiplex pipeline.
Per-stream router that inspects the first
Http2HeadersFrame to determine whether
this stream is a true bidirectional-streaming gRPC method.Per-stream handler for true bidirectional gRPC streaming.
Adapter that bridges gRPC request/response framing for the HTTP/3 path.
Holds the parts of a gRPC response for HTTP/3 framing:
the gRPC-framed body bytes, the grpc-status value, and
an optional grpc-message.
Converts a matched (JSON-bodied)
HttpResponse back into a gRPC wire response:
a length-prefixed protobuf frame plus a grpc-status trailer.Readiness probe:
PUT /mockserver/status on localhost, exit 0 only on HTTP 200.What MockServer logs when an HTTP/1.1 connection closes, by its client's close or reset or otherwise, while a
request's body is still arriving: one
INFO entry with the request's method, path, query string and headers
where the aggregator still holds them, and no stack trace, as an HTTP/2 stream that ends with its connection is
logged by Http2StreamFaults.The last handler of a direct HTTP/2 connection's pipeline.
Emits an HTTP/2
GOAWAY frame on the connection carrying ctx so the client is told
to stop opening new streams and drain — the graceful "this connection is going away" signal a
server sends before a shutdown / preemption.Per-stream child initializer used with
Http2MultiplexHandler
to build the pipeline for every HTTP/2 stream.Limits the header list of an HTTP/2 request to
maxHeaderSize, as HTTP/1.1 limits its header section, and
logs each request refused for it.What MockServer logs when an HTTP/2 stream ends before it should, on a connection made straight to MockServer and
on the client leg of a CONNECT or SOCKS tunnel alike, each once and with no stack trace:
INFO for a request its client cancelled, or whose connection closed, before it was complete;
WARN for an error of the stream's own, which Netty then resets the stream for with the error's code;
WARN for a connection Netty closes because it had to be sent too many of those resets.
See "HTTP/2 streams cut short" in docs/code/netty-pipeline.md for what bounds the entries of one connection.Times one HTTP/2 stream for
mock_server_request_transport_duration_seconds: from its first
HEADERS frame reaching the stream's channel to the write of the frame that ends the response stream
completing.Resets an HTTP/2 stream whose response has data waiting in the connection's flow controller that the client has
taken none of for
responseWriteStallTimeoutMillis.HTTP/3 CONNECT-UDP (MASQUE, RFC 9298) relay handler.
The last handler of an HTTP/3 connection's pipeline.
Drives true bidirectional gRPC streaming over a single QUIC bidirectional stream
(HTTP/3).
A
ResponseWriter that writes gRPC responses over HTTP/3 with correct
gRPC wire framing: initial HEADERS (:status=200,
content-type=application/grpc), DATA (gRPC length-prefixed message),
and trailing HEADERS (grpc-status, grpc-message, plus any trailing metadata the
expectation authored with withTrailer(...)).The last handler of the HTTP/3 UDP listener's pipeline, behind the QUIC codec, which takes no exception itself.
HTTP/3 request stream handler that bridges incoming QUIC requests into
MockServer's standard request-processing pipeline (expectation matching,
actions, recording, proxy forwarding).
Thrown at start-up when
http3Port is set but the QUIC native library cannot be loaded.Converts between HTTP/3 frames and MockServer's
HttpRequest/HttpResponse model.Parsed HTTP/3 pseudo-headers and regular headers.
A
ResponseWriter that serialises the MockServer HttpResponse
as HTTP/3 frames and writes them to a QUIC stream channel.The HTTP/3 listener's segmented (GSO,
UDP_SEGMENT) sends, given to the QUIC codec as its allocator and
placed in the listener's pipeline to watch the sends it makes.HTTP/3 (QUIC) server for MockServer, integrated with the full request pipeline.
Thrown at start-up when
http3Port is set and the HTTP/3 server could not be started on it, so that
MockServer does not run without a protocol it was configured to serve.Resets an HTTP/3 request stream (
RESET_STREAM H3_INTERNAL_ERROR) when writes have been waiting on it for
responseWriteStallTimeoutMillis and QUIC has taken none of them, so a client that stops reading a response
cannot hold it, or a streamed response's upstream, indefinitely.Counts HTTP/1.1 exchanges in progress on a connection for
InboundConnectionIdleHandler: an
exchange starts when a request head is decoded and ends when the last part of its response has been
written to the socket, so a delayed, paused or streaming response keeps the connection busy.Keeps
HttpServerCodec pairing each response with the request it answers when an exchange ends without its
response passing the codec's encoder.The
HttpServerCodec of an HTTP/1.1 connection a client opens, directly or through a CONNECT/SOCKS tunnel.Times each HTTP/1.1 exchange on a connection for
mock_server_request_transport_duration_seconds:
from the request head being decoded to the write of the last part of its response completing on the
socket.What an inbound connection is doing, so
InboundConnectionIdleHandler closes only connections
that are genuinely quiet.Closes an inbound connection that has read and written nothing for
inboundConnectionIdleTimeoutMillis
and has nothing in progress (see InboundConnectionActivity.isBusy(io.netty.channel.Channel)).Counts the inbound connections a MockServer holds open and, when
maxInboundConnections is
set, refuses any connection accepted beyond it.Per-request in-flight token used by the WS7.2 graceful-shutdown connection drain.
The UDP counterpart of the TCP listeners'
LoopbackShadowProbe, for the HTTP/3 and DNS listeners.A
MessagePublisher that publishes Avro messages to Kafka in the
Confluent Schema Registry wire format (magic byte + schema id + Avro binary),
so real Confluent Avro consumers can read them.A
MessageSubscriber that consumes Confluent wire-format Avro
messages from Kafka and records them as JSON — the consume/verify counterpart of
KafkaAvroMessagePublisher.A
MessagePublisher that delegates to a Kafka KafkaProducer.A
MessageSubscriber that uses a Kafka KafkaConsumer to subscribe
to topics and record received messages.Immutable carrier for Kafka security configuration (SASL and/or SSL).
Utility for applying
KafkaSecurity settings to Kafka client
Properties.Cuts a binary connection into messages that each carry their own length:
offset bytes, then an unsigned
length field of prefixBytes (1, 2, 4 or 8) in the byte order given, then the body.A
Http2StreamFrameToHttpObjectCodec that is lenient on the INBOUND (request) side but
strict on the OUTBOUND (response) side.Answers the proxy client with a
502 when the CONNECT/SOCKS relay's HTTP/1.1 loopback fails to decode a
response (a corrupt compressed body, one larger than maxRequestBodySize, or one the codec marks as failed)
before its head has been relayed.Ends the proxy client's HTTP/2 streams at once when the CONNECT/SOCKS relay's HTTP/2 loopback connection closes, for
any reason, instead of leaving them to Netty's 30 s graceful-shutdown timeout.
Answers the proxy client's HTTP/2 stream when the CONNECT/SOCKS relay's HTTP/2 loopback stream for it ends without
a response: the response failed to decode, passed
maxRequestBodySize, or MockServer reset the stream.Gives each request the CONNECT/SOCKS relay writes to its HTTP/2 loopback a loopback stream id of its own, and puts
the proxy client's stream id back on the response.
On MockServer's side of an HTTP/1.1 relay loopback, after its codec: tells the tunnel's relay what the bytes on the
loopback cannot.
Deterministic conformance / contract tester for a target MCP (Model Context Protocol)
server reachable over Streamable HTTP.
Outcome of a single named conformance check.
Result of a single JSON-RPC exchange.
One JSON-RPC exchange against the target server.
Full conformance report.
Registry of MCP prompts exposed by MockServer's own MCP server.
Thrown by
McpPromptRegistry.getMessages(java.lang.String, com.fasterxml.jackson.databind.JsonNode) when a prompts/get call omits a required argument, which
the MCP prompts specification answers with JSON-RPC error -32602 (invalid params).Transport-neutral MCP (Model Context Protocol) JSON-RPC request processor.
Result of processing an MCP request.
Netty channel handler that intercepts MCP (Model Context Protocol) requests
on the TCP (HTTP/1.1 and HTTP/2) path.
Generates example JSON payloads for each channel in an
AsyncApiSpec.Publishes a message payload to a named channel (topic).
Subscribes to a message broker channel and records received messages for
later retrieval/verification — the consumer counterpart of
MessagePublisher.Wires the
IP_TRANSPARENT socket option on the server bootstrap when
TPROXY mode is enabled.A
MessagePublisher that delegates to an MQTT v5
MqttClient.A
MessageSubscriber that uses an MQTT v5 MqttClient to
subscribe to topics and record received messages — the v5 counterpart of
MqttMessageSubscriber.Utility for building an MQTT v5
MqttConnectionOptions from
MqttSecurity configuration — the v5 counterpart of
MqttSecurityOptions.A
MessagePublisher that delegates to an MQTT MqttClient.A
MessageSubscriber that uses an MQTT MqttClient to subscribe
to topics and record received messages.Immutable carrier for MQTT security configuration (username/password and/or SSL).
Utility for building
MqttConnectOptions from MqttSecurity
configuration.Matching of concrete MQTT topic names against MQTT topic filters, per
MQTT 3.1.1 §4.7 (the same wildcard semantics apply to MQTT 5).
Cuts a binary connection into the messages of the MySQL client/server protocol, as a client sends them.
Serves the embedded OpenAPI specification at GET /mockserver/openapi.yaml
Sends a large encoded HTTP/1.1 message to the socket in slices, writing the next slice only while the
connection is writable.
Cuts a binary connection into the messages of the PostgreSQL frontend/backend protocol (version 3), as a client
sends them.
Inbound handler that detects and parses PROXY protocol v1 (text format) and v2 (binary
format) headers prepended to TCP connections by upstream load balancers (e.g., AWS GWLB,
HAProxy, nginx with
proxy_protocol on).Immutable carrier for per-message publish-time options extracted from AsyncAPI bindings.
A received request that has no method or path, such as a DNS query or a binary message, sent as its kind and a
summary for the dashboard to lay out as it lays out an HTTP request's method and path.
An immutable record of a message received from a broker subscription.
Cuts a binary connection into the messages of the Redis serialization protocol (RESP2 and RESP3), as a client sends
them: one complete top-level value with everything nested in it, or, when the first byte names no RESP type, one
inline command up to and including its line feed.
The local addresses of the loopback connections
RelayConnectHandler opens to MockServer, each with the proxy
client's channel of its tunnel, so the accepting side can tell its own relay's loopback leg from a client that merely
sends the same PROXIED_ preamble, and can reach the tunnel's other leg.A minimal client for the Confluent Schema Registry REST API — just the two
operations MockServer needs, implemented over the JDK's
HttpClient so no
Confluent Community License artifacts are pulled in:
SchemaRegistryClient.getSchemaById(int) — GET /schemas/ids/{id}, used on the
consume/verify path to resolve the schema embedded in a Confluent
wire-format message.
SchemaRegistryClient.register(String, String) — POST /subjects/{subject}/versions,
used on the publish path to obtain the schema id to frame messages with.
This class is expected to be used from within a
ReplayingDecoder, or with enough bytes available.Reads the original destination of an intercepted TCP connection on Linux.
Resolves the original destination of a transparently intercepted TCP connection
by calling
getsockopt(fd, SOL_IP, SO_ORIGINAL_DST, ...) via JNA on Linux.Source-address-validating QUIC retry token handler (stateless retry, RFC 9000 §8.1).
Translates a
StreamAddressedHttpContent into the child-channel equivalent when a streaming
response is written on an Http2MultiplexHandler child channel.Netty
ChannelDuplexHandler that injects raw TCP-layer faults
before HTTP decoding, based on the TcpChaosProfile
registered in TcpChaosRegistry for the connection's remote host.Resolves the original destination of a transparently intercepted TCP connection
using the TPROXY (IP_TRANSPARENT) mechanism.
Netty handler that extracts W3C
traceparent / tracestate
headers from inbound HttpRequest objects and stores the parsed
W3CTraceContext as a channel attribute, replacing (or clearing) any
context from an earlier request on the same connection.A Netty channel handler that resolves the original destination for transparently
intercepted connections and stores it as the
HttpActionHandler.REMOTE_SOCKET
channel attribute.Strategy interface for resolving the original destination.
Utility for transparent HTTP proxy mode — provides Host-header parsing helpers
and an
TransparentProxyInitializer.isEnabled() configuration check.What a relay does with the upstream's reply to one message it forwards: relays it to the client (the default),
drops it, or drops it and writes other bytes to the client in its place once it has ended.
Closes an inbound connection when bytes have been waiting for its client for
responseWriteStallTimeoutMillis
and the client has taken none of them, so a client that stops reading cannot hold what is queued for it (and, for a
streamed response, its upstream connection) indefinitely.