Google Protocol Buffers integration is ready.
Tomasz Blachowicz
tblachowicz at gmail.com
Wed Jul 22 13:09:36 EDT 2009
Trustin Lee wrote:
>
> I have finished the implementation of Google Protocol Buffers codec for
> Netty.
>
> Google Protocol Buffers (protobuf) are a way of encoding structured data
> in
> an efficient yet extensible format. Google uses Protocol Buffers for
> almost
> all of its internal RPC protocols and file formats. With protobuf, you
> can
> define a binary protocol very quickly and efficiently. For more
> information, please see here: http://code.google.com/p/protobuf/
>
> With the ProtobufEncoder and ProtobufDecoder that Netty provides, you can
> now write a network application with a very efficient binary encoding even
> more quickly than ever. It just takes little time to implement a codec
> with
> protobuf.
>
> To help your understanding, I have written a time client / server example.
> The time client sends a list of time zones, and then the time server
> responds with the local time for each time zone. Please brwose the
> following directory:
>
> -
>
> http://fisheye.jboss.org/browse/Netty/trunk/src/main/java/org/jboss/netty/example/localtime
>
> Please note that LocalTimeProtocol.java has been generated from
> LocalTimeProtocol.proto by protobuf compiler.
>
> Please feel free to send me a feed back once you review the source code.
> I'd like to know what could be improved to support protobuf better and to
> help you implement an efficient binary protocol more quickly than ever.
>
Here is an idea for improvement of Google Protocol Buffers (protobuf)
support in Netty. Currently each frame is prepended with fixed size four
byte integer value that is a length of the message. Why not to use cool
protobuf varint
(http://code.google.com/apis/protocolbuffers/docs/encoding.html#varints) for
that purpose? By doing this for small messages one could save a few bits of
bandwidth. For instance, messages smaller that 128 bytes can be "framed"
only by one byte representing the size.
I've already implmented FrameDecoded and FieldPrepender that I could share
with you through JIRA. Please, let me know what you think and if you'd
considered such feature for Netty.
Cheers,
Tom
--
View this message in context: http://n2.nabble.com/Google-Protocol-Buffers-integration-is-ready.-tp2122078p3304575.html
Sent from the Netty Developer Group mailing list archive at Nabble.com.
More information about the netty-dev
mailing list