demultiplexing protobuf messages
Nicholas Clare
nickclare at gmail.com
Mon Nov 2 09:20:10 EST 2009
Hi,
I'm not really an expert on Protocol Buffers, but I've been looking at them
recently for a project of mine. One possibility is to have a fixed message
type that has "optional" fields for each possible type of message that could
come in. If the types of possible messages is too flexible to make this a
reasonable option, protocol buffers does have an extension mechanism,
although I am not too familiar with it, but from what I remember it should
also be a possibility.
If you can't wrap all your messages in one container type, then I think the
option you're suggesting is definitely another option.
Hope this helps a bit,
Nick
On Mon, Nov 2, 2009 at 2:04 PM, sandstorm_sh <sandstorm_sh at abv.bg> wrote:
>
> How can we demultiplex protobuf messages, given the fact that a message has
> not any type defining header information in itself, and the protocol we are
> trying to define is message-flexible so to say, i.e. has not got any fixed
> message sequence hardcoded into the protocol definition.
>
> one solution is to prepend the type header like a lengthfieldprepender
> prepends a length field, and to decode the message with an appropriate
> protobuf decoder.
>
> we can maintain a collection of decoders for the corresponding types, but
> the problem is that the decode method is protected, not public, and we can
> not invoke it.
>
> so we should use the pipeline somehow, and my question is what is the
> standard idiom for this particular situation: do we have to replace
> handlers
> in the pipeline, based on the incoming message type ?
>
> what is the standard thing to do ?
>
>
> example code in the netty distribution contains protobuf examples, but
> there
> is one message type incoming and outgoing..
>
> im a bit newbie in netty, so i'd like some elaboration on this topic,
> thanks
> --
> View this message in context:
> http://n2.nabble.com/demultiplexing-protobuf-messages-tp3931395p3931395.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/20091102/7a4ed1ff/attachment-0001.html
More information about the netty-users
mailing list