I have implemented a channel handler for handling http pipelining. My code is at github: https://github.com/huntc/netty-http-pipelining
My question is around the approach that I have taken and whether it is a reasonable one in the context of Netty's architecture.
When my HttpPipeliningHandler receives an upstream HttpRequest it then forms a new message event of type OrderedUpstreamMessageEvent. This event is also part of my package and retains information in relation to the request that will be required when formulating reply messages.
When a channel handler further upstream receives the OrderedUpstreamMessageEvent it forms a reply by generating a OrderedDownstreamMessageEvent e.g.:
ctx.sendDownstream(new OrderedDownstreamMessageEvent(oue, somemessage));
where
ctx = ChannelHandlerContext instance
oue = OrderedUpstreamMessageEvent instance
somemessage = some message instance to be sent as an http response
You can also do more fun stuff like send chunked replies.
Does this approach look reasonable? It certainly works! Is it regular/acceptable to transform message events in an upstream handler? Obviously if the message event is transformed again then the pipelining functionality will not work.