@Override
public ChannelPipeline getPipeline() throws Exception {
ChannelPipeline pipeline = pipeline();
pipeline.addLast("requestEncoder", new HttpRequestEncoder());
pipeline.addLast("channelEncoder", new HttpEncoder(host, uri));
pipeline.addLast("responseDecoder", new HttpResponseDecoder());
pipeline.addLast("aggregator", new HttpChunkAggregator(1048576));
pipeline.addLast("thriftHandler", (ChannelHandler)handler);
return pipeline;
}