You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@avro.apache.org by Pankaj Shroff <sh...@gmail.com> on 2013/02/25 18:42:00 UTC

Avro - top level message type

In many protocols defined using JSON, very often the top level request name
is not the first "string" type in the JSON payload received on the wire.
For example for a protocol that defines a top level message "Request" the
actual JSON received by the server would actually be
"{
    "param1": "String Parameter for request",
    "3.4567" : "Float parameter for request",
    "false" : "Boolean parameter for request"
}"

Note how there is no sight of the message name "Request".

Yet - the Avro implementation (1.7.3) of Responder class assumes that
(after completing successful handshake in the first message of a live
connection) the first token in the received payload should be this message
name. It then uses this message name to construct the SpecificRecord object
mapping from the json received (above).

How does someone handle top level protocol messages like these in the
SpecificResponder and further derived classes?

Thanks in advance!

Pankaj

-- 
Pankaj Shroff
twitter: @chompi

http://github.com/chompi
http://github.com/openrtb/openrtb2x