Avro RPC is currently specified to always uses the binary encoding
(like Avro data files). This might reasonably be extended to JSON.
First we'd need to specify the new wire format. Probably Avro's
framing would not make sense for JSON-encoded RPC over HTTP. Then
we'd need to figure what of the existing Java implementation might be
reused or adapted. At a glance, it doesn't look to me like a few
one-line changes would suffice, adding methods where things are
hardwired, that rather more substantial changes would be required, but
I might be missing something. If you're interested in pursuing this
then please file an issue in Jira where you can propose changes to the
specification and implementation.
On Wed, Feb 27, 2013 at 11:16 AM, Pankaj Shroff <[EMAIL PROTECTED]> wrote:
> I guess my question is more basic - given that this is somewhat specific to
> my own use case:
> How does one use other forms of Encoder/Decoder implementations that are
> available in the Avro library along with the Avro-Ipc SDK.
> As of 1.7.3, I see that the only Encoding/Decoding that Avro-ipc supports is
> the BinaryEncoding
> On Mon, Feb 25, 2013 at 2:25 PM, Pankaj Shroff <[EMAIL PROTECTED]> wrote:
>> Perhaps you answered a portion of my conundrum in another thread
>> (permalink below) - but there is still the handshake and reuse of invocation
>> logic question. Let me also think about this a little bit.
>> Thanks in any case. Avro is a great tool in any case!
>> [EMAIL PROTECTED]
>> On Mon, Feb 25, 2013 at 1:38 PM, Doug Cutting <[EMAIL PROTECTED]> wrote:
>>> This sounds like a different RPC wire format than Avro's. Avro's
>>> Requestor and Responder implement Avro's RPC wire format. Avro's
>>> Encode/Decoder and DatumReader/DatumWriter APIs should facilitate
>>> implementation of other RPC wire formats that include Avro data.
>>> Avro's Transceiver API may or may not be reusable, since it assumes
>>> Avro-style framing. Parts of Requestor and Responder *might* be
>>> reusable and some refactoring of those classes *might* make such reuse
>>> easier, but there's not that much logic there that's not specific to
>>> Avro's wire format, so it might be just as easy to reimplement this
>>> layer for a different wire format. It's hard for me to say without
>>> seeing a patch with a proposed refactoring. Does that make sense?
>>> On Mon, Feb 25, 2013 at 9:08 AM, Pankaj Shroff <[EMAIL PROTECTED]> wrote:
>>> > Hi
>>> > We are using Avro for implementing an open source reference
>>> > implementation
>>> > of the OpenRTB protocol.
>>> > We have made a design goal to model the protocol using Avro protocol
>>> > files
>>> > (.avpr) and generate types defined in the protocol schema using Avro .
>>> > The
>>> > challenge is that the protocol does not necessarily require the use of
>>> > Avro/
>>> > Binary wire encoding - or even the use of Avro/ RPC context. In fact
>>> > many
>>> > counter parties have proprietary implementations supporting either
>>> > Protobuf
>>> > or Json encoding.
>>> > Now, there is a Json encoder/decoder in the Avro package but it seems
>>> > that
>>> > the approach is a "schema-first" approach. The JsonEncoder assumes that
>>> > the
>>> > encoding on the wire still follows the Avro Json encoding - which
>>> > includes a
>>> > handshake followed by schema confirmation on both sides (client and
>>> > server).
>>> > For the protocol we are implementing - this presents 2 problems if
>>> > Avro/
>>> > binary is not the chose encoding type for both sides - and if instead,
>>> > lets
>>> > say, raw Json encoding is being used
>>> > 1) the handshake is rather Avro specific - and we would like to
>>> > completely
>>> > skip it if both sides have agreed on using raw json encoding - there