avro-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Evan McClain <aeroe...@gmail.com>
Subject Re: Autogenerating Java classes from IDL
Date Sun, 31 Jan 2016 00:13:37 GMT
I have used IDLs with the avro-maven-plugin and that worked for me.


On Sat, Jan 30, 2016, 8:52 AM tl <tl@rat.io> wrote:

> Hi,
> I started working with Avro only recently so maybe I missed something but
> it seems to me that schemas can be defined in JSON as well as in IDL but
> only from JSON schemas can builder classes be autogenerated. This is a pity
> since IDLs are much easier to write and read than the JSON representation.
> I wrote a few IDL schemas, converted them to avpr and tweaked those avpr
> files to become valid avsc schema files from which I autogenerated the
> classes. This is a rather convoluted process. I wouldn’t mind so much if I
> wouldn’t know that I or somebody else will have to update the schemas and
> classes from time to time. This doesn’t look like a robust workflow.
> Deleting the IDLs and avpr files and doing updates only in the avsc
> schemas reduces the workflow to 2 steps but I loose the nice properties of
> IDLs [0].
> Using only generic mapping would reduce the workflow by one step too but
> I’d loose static type checking.
> I’d love to be able to autogenerate the Java classes from the IDLs
> directly. Is there a way?
> Regards,
> Thomas
> [0] Regarding IDLs it would be cool if I could forward reference objects
> in the schema or even write nested schemas but that’s a relatively minor
> gripe.

View raw message