avro-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matt Stevenson <matt.r.steven...@gmail.com>
Subject Re: C++/Java schema compatibility
Date Wed, 12 Oct 2011 22:14:20 GMT
Yes, Java has full support and C++ does not.

I do not know of a way to use an .avpr in C++.If it doesn't already exist,
you could make a script to pull out records and namespaces from an .avpr and
then generate.

imho, adding full protocol/RPC support from a schema is a bigger priority
than code gen.

On Wed, Oct 12, 2011 at 4:48 PM, Shaun Williams <shaunwilli42@gmail.com>wrote:

> So is there richer schema support for java than c++?  I am trying to use
> avro RPC as the protocol between a java client and a c++ server.  I was
> hoping that I could define the schemas once and generate code for both
> platforms.  Is that not possible at the moment?
>
> Thanks!
>
> Shaun
>
>
> On Wed, Oct 12, 2011 at 2:30 PM, Matt Stevenson <
> matt.r.stevenson@gmail.com> wrote:
>
>> Sorry, I wasn't paying attention and thought the Java class was json.
>>
>> Save this as a .json:
>>
>>> {
>>>     "name": "Message", "type": "record",
>>>     "fields": [
>>>         {"name": "to", "type": "string"},
>>>         {"name": "from", "type": "string"},
>>>         {"name": "body", "type": "string"}
>>>     ]
>>> }
>>>
>>
>>
>> On Wed, Oct 12, 2011 at 4:27 PM, Matt Stevenson <
>> matt.r.stevenson@gmail.com> wrote:
>>
>>> The avrogencpp tool will only parse individual records.
>>> If you save
>>>
>>> record Message {
>>>  string to;
>>>  string from;
>>> string body;
>>> }
>>>
>>> as a .json file, it will generate the class.
>>> I think only records are supported in C++ and not full protocols.
>>>
>>>
>>> On Wed, Oct 12, 2011 at 1:37 PM, Shaun Williams <shaunwilli42@gmail.com>wrote:
>>>
>>>> I'm trying to compile the Mail.avpr schema from the avro-rpc-quickstart
>>>> example using the c++ tools, and precompile fails with the following error:
>>>> "Failed to parse or compile schema: Schema is invalid, due to bad node
>>>> of type symbolic."
>>>>
>>>> I even tried generating the avpr from an avdl, but precompile still
>>>> fails with the same error.  Any idea what the problem might be?
>>>>
>>>> Here's my avdl FYI:
>>>>
>>>> @namespace("example.proto")
>>>> protocol Mail{
>>>> record Message {
>>>> string to;
>>>>  string from;
>>>> string body;
>>>> }
>>>>
>>>> string send(Message message);
>>>> }
>>>>
>>>> Thanks!
>>>>
>>>
>>>
>>>
>>> --
>>> Matt Stevenson.
>>>
>>
>>
>>
>> --
>> Matt Stevenson.
>>
>
>


-- 
Matt Stevenson.

Mime
View raw message