private void configureHttp2(ChannelPipeline pipeline) {

        // setup the initial stream settings for the server to use.
        Http2Settings settings = new Http2Settings()
                .maxConcurrentStreams(maxConcurrentStreams)
                .initialWindowSize(initialWindowSize)
                .headerTableSize(maxHeaderTableSize)
                .maxHeaderListSize(maxHeaderListSize);

        Http2FrameCodec frameCodec = Http2FrameCodecBuilder.forServer()
                .frameLogger(FRAME_LOGGER)
                .initialSettings(settings)
                .validateHeaders(true)
                .build();
        Http2Connection conn = frameCodec.connection();
        // Use the uniform byte distributor until https://github.com/netty/netty/issues/10525 is fixed.
        conn.remote()
                .flowController(new DefaultHttp2RemoteFlowController(conn, new UniformStreamByteDistributor(conn)));

        Http2MultiplexHandler multiplexHandler = new Http2MultiplexHandler(http2StreamHandler);

        // The frame codec MUST be in the pipeline.
        pipeline.addBefore("codec_placeholder", null, frameCodec);
        pipeline.replace("codec_placeholder", BaseZuulChannelInitializer.HTTP_CODEC_HANDLER_NAME, multiplexHandler);
        if (catchConnectionErrors) {
            pipeline.addLast(new Http2ConnectionErrorHandler());
        }
    }
this method is inspired by ApplicationProtocolNegotiationHandler.userEventTriggered
zuul-core/src/main/java/com/netflix/zuul/netty/server/http2/Http2OrHttpHandler.java