@Override
        public void configure(final ChannelPipeline pipeline) {
            final String scheme = connection.getUri().getScheme();
            if (!"http".equalsIgnoreCase(scheme) && !"https".equalsIgnoreCase(scheme))
                throw new IllegalStateException("Unsupported scheme (only http: or https: supported): " + scheme);

            if (!supportsSsl() && "https".equalsIgnoreCase(scheme))
                throw new IllegalStateException("To use https scheme ensure that enableSsl is set to true in configuration");

            if (cluster.getIdleConnectionTimeout() > 0) {
                // idle connection handling is enabled
                pipeline.addLast(PIPELINE_IDLE_STATE_HANDLER, idleStateHandler);
                pipeline.addLast(PIPELINE_IDLE_CONNECTION_HANDLER, idleConnectionHandler);
            }

            final HttpClientCodec handler = new HttpClientCodec(DEFAULT_MAX_INITIAL_LINE_LENGTH, DEFAULT_MAX_HEADER_SIZE,
                    1024 * 1024, DEFAULT_FAIL_ON_MISSING_RESPONSE,
                    DEFAULT_VALIDATE_HEADERS, DEFAULT_INITIAL_BUFFER_SIZE, DEFAULT_PARSE_HTTP_AFTER_CONNECT_REQUEST,
                    DEFAULT_ALLOW_DUPLICATE_CONTENT_LENGTHS, false);

            pipeline.addLast(PIPELINE_HTTP_CODEC, handler);
            pipeline.addLast(PIPELINE_HTTP_AGGREGATOR, new HttpObjectAggregator(cluster.getMaxResponseContentLength() > 0
                    ? (int) cluster.getMaxResponseContentLength() : Integer.MAX_VALUE));
            pipeline.addLast(PIPELINE_HTTP_ENCODER, gremlinRequestEncoder);
            pipeline.addLast(PIPELINE_HTTP_DECOMPRESSION_HANDLER, httpCompressionDecoder);
            pipeline.addLast(PIPELINE_HTTP_DECODER, gremlinResponseDecoder);
        }
This response is used as a signal for determining if all content of the response has been read.
gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/Channelizer.java