Netty and protobuf protocol with complex messages

Marc-André Laverdière marcandre.laverdiere at gmail.com
Thu Jun 2 12:27:39 EDT 2011


Hello. I guess it also depends on how complex your protocol is. Personally,
I am using a decoder that switches between the different possible ones based
on state. It gets the job done.
On 02-Jun-2011 6:33 PM, "alex77" <alejandro.domenech at citi.com> wrote:
> Hi everyone.
>
> I'm quite new to Netty and I've spent the last week looking for
information
> and examples about how to implement a client-server communication protocol
> using Netty and protobuf that supports multiple protobuf messages. As
> everyone else, I took a look to the example in the doc, but as usual, the
> protocol only contains one single protobuf message.
>
> I've found some posts with suggestions about using an envelope message
that
> will contain the actual protobuf data making use of extensions, and also
an
> alternative suggesting to write a protocol that will prepend the message
> type, the length and then the actual protobuf data, so on reception you
> could use a DecoderEmbedder that will instanciate the proper
ProtobufDecoder
> depending on the message type.
>
> Also I saw some recent code contribution trying to implement a generic
> decoder that will accept in the constructor a map of ProtobufDecoders (or
a
> list and build the map from it) to try to figure out what's the right one
to
> use depending on the message type.
>
> All these seem to be attempts or suggstions, and I was wondering if
there's
> a proper way (the official Netty way) to solve this type of problem, as I
> guess it's quite common. Is there any plan to add support in a future
> release a decoder to do this demultiplexing functionality?
>
> Not sure the solution Trustin pointed
> http://www.jboss.org/netty/community.html#nabble-td3931395 here is a good
> one, as it instanciates a new DecoderEmbedder with a new instance of the
> concrete protobuf decoder every time we parse the body of a message.
Indeed
> it shows the general idea, but sure there's an efficient way to solve this
> problem.
>
> Many thanks in advance!
>
> --
> View this message in context:
http://netty-forums-and-mailing-lists.685743.n2.nabble.com/Netty-and-protobuf-protocol-with-complex-messages-tp6431047p6431047.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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/netty-users/attachments/20110602/2a8494b3/attachment.html 


More information about the netty-users mailing list