Class Http2ForwardStreamChildInitializer
- All Implemented Interfaces:
io.netty.channel.ChannelHandler,io.netty.channel.ChannelInboundHandler
Http2MultiplexHandler
on the NettyHttpClient forward path. It mirrors the HTTP/1.1 forward pipeline built by
HttpClientInitializer.configureHttp1Pipeline(io.netty.channel.ChannelPipeline) but on an HTTP/2 stream channel, so a streamed
upstream response (Server-Sent Events) is relayed incrementally instead of being aggregated to
completion before its head reaches the proxy client.
An HTTP/2 stream channel is decoded into the same unaggregated HttpObjects that the
HTTP/1.1 path produces (Http2StreamFrameToHttpObjectCodec in CLIENT, non-aggregating mode),
then the identical shared streaming machinery is reused: HttpContentDecompressor,
TimeToFirstByteHandler, StreamingAwareHttpObjectAggregator (which relays
text/event-stream / client-requested streams via StreamingResponseRelayHandler and
aggregates everything else to a FullHttpResponse), MockServerHttpClientCodec, and the
shared HttpClientHandler.
HTTP/2 child channels do NOT inherit parent-channel attributes, so the per-request attributes the
forward machinery reads off the channel are copied from the parent to the child in
initChannel(io.netty.handler.codec.http2.Http2StreamChannel). A close listener closes the parent connection when the single stream ends,
preserving the non-pooled "close after one response" behaviour of HTTP/2 forwards.
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.netty.channel.ChannelHandler
io.netty.channel.ChannelHandler.Sharable -
Method Summary
Modifier and TypeMethodDescriptionprotected voidinitChannel(io.netty.handler.codec.http2.Http2StreamChannel ch) Methods inherited from class io.netty.channel.ChannelInitializer
channelRegistered, exceptionCaught, handlerAdded, handlerRemovedMethods inherited from class io.netty.channel.ChannelInboundHandlerAdapter
channelActive, channelInactive, channelRead, channelReadComplete, channelUnregistered, channelWritabilityChanged, userEventTriggeredMethods inherited from class io.netty.channel.ChannelHandlerAdapter
ensureNotSharable, isSharable
-
Method Details
-
initChannel
protected void initChannel(io.netty.handler.codec.http2.Http2StreamChannel ch) - Specified by:
initChannelin classio.netty.channel.ChannelInitializer<io.netty.handler.codec.http2.Http2StreamChannel>
-