Hello,
We have been using Avro successfully to serialize many of our objects,
using binary encoding, for storage and retrieval. Although the
documentation about the Reflect Mapping states:
This API is not recommended except as a stepping stone for systems
that currently uses Java interfaces to define RPC protocols.
we used this mapping as that recommendation did not seem to apply. We
do not use the serialized data for RPC (or any other messaging
system). In fact, this part has in-place for a while and works
exceptionally well.
Now we would like to "externalize" a smaller subset of the objects for
interaction with a WebApp. Here we would like to use the JSON encoding
and the "specific" mapping. We tried having this set of objects
implement "GenericRecord", however, this then breaks the use of
Reflection on these objects. [The ReflectData.createSchema method
checks for this condition.]
Can Avro be used to serialize objects one way, and externalize them
another? [The externalized objects are a subset of the serialized
ones.] Perhaps more generally, my question is: can both binary
encoding and JSON encoding be supported on overlapping objects using
different mappers? If yes, what is the best way to accomplish this?
Thanks for any help - I am still quite a noob here so I greatly
appreciate any additional details!
Joe Gamache
- Support for Serialization and Externalization? Joe Gamache
-