Multiple ChannelPipelines per Channel

Trustin Lee (이희승) trustin at gmail.com
Fri Oct 16 03:05:43 EDT 2009


Hello,

If I understood correctly, you want to retain the original buffer and
send it to the proxied server in verbatim.  Then HttpMessageDecoder
does a lot of unnecessary job for your use case, so I'd recommend you
to write your own decoder for maximum performance.  The decoder could
be as simple as determining the beginning and end of an HTTP message,
instead of decoding every attribute of the message.  You will not even
need an encoder I guess then?

HTH

— Trustin Lee, http://gleamynode.net/



On Tue, Oct 13, 2009 at 6:30 AM, McCloud <Duncan.Doyle at gmail.com> wrote:
>
> Hello,
>
> I'm pretty new to Netty. I'm currently trying to build an HTTP proxy, which
> apart from receiving requests from a client and forwarding them to the
> proxied server (and vice versa for the response), is able to decode the data
> into HttpRequest and HttpResponse messages. These messages will later used
> to analyse response time, etc. in a different (remote) component.
>
> I based the initial version on the proxy example supplied by Netty (I
> slightly modified the structure). The example provided just dumps the data
> in Hex format. Then I noticed the Http examples, which use the
> HttpRequestEncoder and Decoder classes. I don't however want to first decode
> and then encode the proxied data due to possible performance issues, I want
> the proxy to be as fast as possible.
>
> So my idea was to attach 2 ChannelPipelines to the same Channel (for both
> the server side and client side channels). One pipeline is responsible for
> the proxy functionality, the other pipeline is responsible for decoding the
> data into HttpRequests (on the server side channel) and HttpResponses (on
> the client side channel) and sending the data to a remote component for
> analysis. Both ChannelPipelines will use their own Executor (or Thread).
>
> Is this possible in Netty with the default API, or do I need to extend the
> framework in one way or the other.
>
> Regards,
>
> Duncan
> --
> View this message in context: http://n2.nabble.com/Multiple-ChannelPipelines-per-Channel-tp3810809p3810809.html
> Sent from the Netty User Group mailing list archive at Nabble.com.
> _______________________________________________
> netty-users mailing list
> netty-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/netty-users
>



More information about the netty-users mailing list