> On Jun 20, 2017, at 11:23 AM, Wenzhao Zhang <wzhan...@ncsu.edu> 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

Reply via email to