dev@grizzly.java.net

Re: Questions about Protocol Buffer Implementation

From: cdollins <chad.dollins_at_gmail.com>
Date: Tue, 19 Apr 2011 20:08:49 -0700 (PDT)

This is a first cute of the work for protocol buffers in grizzly
https://github.com/cdollins/grizzly-google-protobufs
grizzly-google-protobufs . Interestingly enough this can be cloned directly
inside of extras and the extras pom only need reference the new module
google-protobufs. Isn't git great!

Currently in the style of the StringFilter an int is used indicate protobuf
message size in bytes. That is the assumption that all protocol buffers
coming over the connection will be preceded by 4 bytes indicating the
remaining bytes to read that represent the message itself.

Implementation Questions:

1. Do we want a variable length header i.e. varint encoded length header as
is done in latest netty? This is similar to the
http://code.google.com/apis/protocolbuffers/docs/encoding.html#varints
protobuf it self's encoding

2. Do we want to separate out the message length from protocol buffer
message codec? This might relieve the burden of external applications to
interpret the assumed byte size header and allow greater flexibility for
header implementation. i.e. see the above possible encoding for a message
size.

3. What if multiple types protobuf messages come down the pipe? As far as I
can tell netty does not address this issue. One possible solution is store a
message code in a separate header preceding the message. What I would like
to see which would solve a lot of problems is a kin to
com.sun.jersey.config.property.packages initParam that detects classes to
use as resources for a web application. That is automatically build up
message type based on a set of classes. Just sayin.

--
View this message in context: http://grizzly.1045725.n5.nabble.com/Questions-about-Protocol-Buffer-Implementation-tp4305806p4314834.html
Sent from the Grizzly - Development mailing list archive at Nabble.com.