Class StreamFrameCallbackDispatcher

java.lang.Object
org.mockserver.mock.breakpoint.StreamFrameCallbackDispatcher

public class StreamFrameCallbackDispatcher extends Object
Dispatches stream-frame breakpoint-held frames to a callback WebSocket client for interactive resolution. This is the per-frame analogue of BreakpointCallbackDispatcher (which handles buffered REQUEST/RESPONSE phases).

Protocol (frozen contract)

  • Server to client: a PausedStreamFrameDTO carrying the correlationId, streamId, sequenceNumber, direction, phase, body (Base64), and light request context.
  • Client to server: a StreamFrameDecisionDTO carrying the correlationId, action (CONTINUE/MODIFY/DROP/INJECT/CLOSE), and optional body (Base64, for MODIFY/INJECT).

Safety rails

Frame ordering

Frames within a stream are dispatched one at a time: the caller parks the frame and chains its continuation on the returned future. The existing backpressure mechanisms (streaming body requestMore(), autoRead=false, withhold ctx.read()) ensure that the next frame is not delivered until the current one resolves — preserving the same ordering guarantees as the REST-park path.

This class is thread-safe. Correlation handlers are registered before the WS message is sent, and cleaned up on completion/timeout/disconnect.