@Override
    protected void configurePipeline(ChannelHandlerContext ctx, String protocol) throws Exception {
        if (protocol.equals(ApplicationProtocolNames.HTTP_2)) {
            ctx.channel().attr(PROTOCOL_NAME).set(PROTOCOL_HTTP_2);
            configureHttp2(ctx.pipeline());
            return;
        }
        if (protocol.equals(ApplicationProtocolNames.HTTP_1_1)) {
            ctx.channel().attr(PROTOCOL_NAME).set(PROTOCOL_HTTP_1_1);
            configureHttp1(ctx.pipeline());
            return;
        }

        throw new IllegalStateException("unknown protocol: " + protocol);
    }
this method is inspired by ApplicationProtocolNegotiationHandler.userEventTriggered
zuul-core/src/main/java/com/netflix/zuul/netty/server/http2/Http2OrHttpHandler.java