Class GrpcMultiplexChildInitializer

java.lang.Object
io.netty.channel.ChannelHandlerAdapter
io.netty.channel.ChannelInboundHandlerAdapter
io.netty.channel.ChannelInitializer<io.netty.handler.codec.http2.Http2StreamChannel>
org.mockserver.netty.grpc.GrpcMultiplexChildInitializer
All Implemented Interfaces:
io.netty.channel.ChannelHandler, io.netty.channel.ChannelInboundHandler

public class GrpcMultiplexChildInitializer extends io.netty.channel.ChannelInitializer<io.netty.handler.codec.http2.Http2StreamChannel>
Per-stream child initializer used with Http2MultiplexHandler when the gRPC bidi-streaming multiplex pipeline is enabled.

Phase 3a: installs GrpcBidiRouterHandler as the first handler (after LOCAL_HOST_HEADERS propagation). The router inspects the first HEADERS frame per stream and decides whether to install the bidi streaming handler (for true bidi methods) or the existing re-aggregating chain (for unary, server-streaming, client-streaming, and non-gRPC streams). Non-bidi streams are byte-for-byte identical to the Phase 0 path.

The re-aggregating chain (Http2StreamFrameToHttpObjectCodec + HttpObjectAggregator + downstream handlers) is factored into the static installReAggregatingChain(io.netty.channel.ChannelPipeline, org.mockserver.configuration.Configuration, org.mockserver.logging.MockServerLogger, boolean, java.security.cert.Certificate[], io.netty.channel.Channel, org.mockserver.netty.websocketregistry.CallbackWebSocketServerHandler, org.mockserver.dashboard.DashboardWebSocketHandler, org.mockserver.netty.mcp.McpStreamableHttpHandler, org.mockserver.netty.unification.TraceContextHandler, org.mockserver.netty.unification.AltSvcHeaderHandler, org.mockserver.netty.grpc.GrpcToHttpResponseHandler, org.mockserver.netty.grpc.GrpcToHttpRequestHandler, org.mockserver.netty.HttpRequestHandler) method so the router can install it for non-bidi streams.

  • Nested Class Summary

    Nested classes/interfaces inherited from interface io.netty.channel.ChannelHandler

    io.netty.channel.ChannelHandler.Sharable
  • Constructor Summary

    Constructors
    Constructor
    Description
    GrpcMultiplexChildInitializer(Configuration configuration, LifeCycle server, HttpState httpState, HttpActionHandler actionHandler, MockServerLogger mockServerLogger, McpSessionManager mcpSessionManager, boolean sslEnabled, Certificate[] clientCertificates)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
    initChannel(io.netty.handler.codec.http2.Http2StreamChannel ch)
     

    Methods inherited from class io.netty.channel.ChannelInitializer

    channelRegistered, exceptionCaught, handlerAdded, handlerRemoved

    Methods inherited from class io.netty.channel.ChannelInboundHandlerAdapter

    channelActive, channelInactive, channelRead, channelReadComplete, channelUnregistered, channelWritabilityChanged, userEventTriggered

    Methods inherited from class io.netty.channel.ChannelHandlerAdapter

    ensureNotSharable, isSharable

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

  • Method Details

    • initChannel

      protected void initChannel(io.netty.handler.codec.http2.Http2StreamChannel ch)
      Specified by:
      initChannel in class io.netty.channel.ChannelInitializer<io.netty.handler.codec.http2.Http2StreamChannel>