Thanks, But I think Mesos right now uses Proto2, not Proto3. If I switch entirely to a REST server with ProtocalBuffer, I think this will be fully compatible with Mesos?
Thanks Wenzhao On Wed, Jun 21, 2017 at 3:53 AM, James Peach <[email protected]> wrote: > > > On Jun 20, 2017, at 11:23 AM, Wenzhao Zhang <[email protected]> wrote: > > > > Hello, All: > > > > I'm working on an independent server, which should be able to talk to the > > master&client via HTTP POST requests. > > I setup a Jersey REST server. My initial plan is to use *JSON/XML* to > map > > Entities, as this is widely used. > > > > However, I find some communication compatibility issues, > > 1. I generate the Java classes from the *.proto files. > > I try to create an Event.Offers object via a REST (with *JSON*) call, > > but get some data stream deserializing errors. > > I think this is because of the complex structure of the generated > > classes. They are not POJO's, e.g. they don't have public constructors. > > Your JSON serializer needs to follow the Protobuf JSON mapping, with the > exception that field names are not mapped to lowerCamelCase. > > https://developers.google.com/protocol-buffers/docs/proto3#json > > > > 2. "src/cli/execute.cpp" sets "ContentType" to "*PROTOBUF*". > > I think in most cases, Mesos internally uses "PROTOBUF", not JSON. > > > > So, given the above issues, > > Should I implement my server with *ProtocalBuffer*, is this a better > > approach? > > Or should I try to convert PROTOBUF to JSON inside Mesos? > > > > Could anyone kindly give some suggestions? I become confused on this > point. > > > > Thanks very much > > Wenzhao > >
