protobuf and MessageLite
Jan Van Besien
janvanbesien at gmail.com
Tue May 4 08:41:38 EDT 2010
Hi
I'm using Netty for a simple client/server style application with protobuf
serialization. Netty is used for the client, and for a mock of the server.
The actual server is an embedded C++ application running with limited cpu
and memory resources. For that reason, we configured protobuf to be
optimized for a "LITE_RUNTIME".
The Java classes generated by protobuf therefore implement the MessageLite
interface, rather than the Message interface (Message extends MessageLite).
The ProtobufEncoder and ProtobufDecoder from Netty however depend on the
Message interface. I created my own ProtobufLiteEncoder and
ProtobufLiteDecoder based on the ones from Netty, and all I had to change
was to replace all usages of Message with MessageLite. In other words, it
seems the provided encoder and decoder don't rely on the extra methods in
the Message interface.
Would it be a good idea to change the default encoder en decoder for
protobuf to use the MessageLite interface?
Kind regards
Jan
--
View this message in context: http://netty-forums-and-mailing-lists.685743.n2.nabble.com/protobuf-and-MessageLite-tp5003088p5003088.html
Sent from the Netty User Group mailing list archive at Nabble.com.
More information about the netty-users
mailing list