here is my implements,is it right?
public ChannelPipeline getPipeline() throws Exception
{
ChannelPipeline p = pipeline();
pipeline.addLast("decoder", new HttpRequestDecoder());
p.addLast("frameDecoder", new ProtobufVarint32FrameDecoder());
p.addLast("protobufDecoder", new ProtobufDecoder(LocalTimeProtocol.Locations.getDefaultInstance()));
pipeline.addLast("encoder", new HttpResponseEncoder());
p.addLast("frameEncoder", new ProtobufVarint32LengthFieldPrepender());
p.addLast("protobufEncoder", new ProtobufEncoder());
p.addLast("handler", new LocalTimeServerHandler());
return p;
}
It will not work. You have to write a handler that gets the content of the HTTP request and converts the content of the request (ChannelBuffer) into a protobuf message. Similar work needs to be done for downstream, too.