Skip to content

Not able to configure my own ChannelPipeline #88

Closed
@charlesk40

Description

@charlesk40

I want to override the HttpContentDecompressor which I would like to use it for decoding gzip file types. But since some response come in without the proper contentEncoding header, HttpContentDecompressor is ignored. Can we make it so that we can construct custom handlers to the ChannelPipeline?

plainBootstrap.setPipelineFactory(new ChannelPipelineFactory() {

        /* @Override */
        public ChannelPipeline getPipeline() throws Exception {
            ChannelPipeline pipeline = pipeline();

            pipeline.addLast(HTTP_HANDLER, new HttpClientCodec());

            if (config.getRequestCompressionLevel() > 0) {
                pipeline.addLast("deflater", new HttpContentCompressor(config.getRequestCompressionLevel()));
            }

            if (config.isCompressionEnabled()) {
                pipeline.addLast("inflater", new HttpContentDecompressor());
            }
            pipeline.addLast("chunkedWriter", new ChunkedWriteHandler());
            pipeline.addLast("httpProcessor", NettyAsyncHttpProvider.this);
            return pipeline;
        }
    });

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions