@Override
        public void initChannel(SocketChannel ch) throws Exception {
            final ChannelPipeline p = ch.pipeline();
            final Http2Connection conn = new DefaultHttp2Connection(false);
            final HttpToHttp2ConnectionHandler connHandler = new HttpToHttp2ConnectionHandlerBuilder()
                    .connection(conn)
                    .frameListener(new DelegatingDecompressorFrameListener(
                            conn,
                            new InboundHttp2ToHttpAdapterBuilder(conn)
                                    .maxContentLength(Integer.MAX_VALUE)
                                    .propagateSettings(true).build()))
                    .build();

            clientHandler = new THttp2ClientHandler(ch.eventLoop());

            if (sslCtx != null) {
                p.addLast(sslCtx.newHandler(p.channel().alloc()));
                p.addLast(connHandler);
                configureEndOfPipeline(p);
            } else {
                final HttpClientCodec sourceCodec = new HttpClientCodec();
                final HttpClientUpgradeHandler upgradeHandler = new HttpClientUpgradeHandler(
                        sourceCodec, new Http2ClientUpgradeCodec(connHandler), 65536);

                p.addLast(sourceCodec, upgradeHandler, new UpgradeRequestHandler());
            }
        }
An extremely simple Thrift-over-HTTP/2 client which sends and receives a single Thrift request/response
per connection.
thrift/thrift0.13/src/test/java/com/linecorp/armeria/server/thrift/AbstractTHttp2Client.java