I can't find much doco on this topic, but i'm serialising an object to Avro and then sending to Azure EventHub.. I think the Avro needs to contain schema too.. because without, how will a consumer (I.e. Azure Stream Analytics for example) know how to deserialise?
The only example i can locate online uses Microsoft.Hadoop.Avro.Container
namespace.. this seems to work fine, i can read via Stream Analytics.. but does this code 'automagically' include the schema in the payload? I sure as can't see any reference to it here:
using (var memoryStream = new MemoryStream())
using (var writer = AvroContainer.CreateWriter<T>(memoryStream, Codec.Null))
using (var seqWriter = new SequentialWriter<T>(writer, items.Count()))
{
foreach (var e in items)
{
seqWriter.Write(e);
}
return memoryStream.ToArray();
}
The landscape of Avro in .Net seems a bit confused, why is there a Microsoft specific NuGet pkg? It seems quite old, has it now been superseded by something? Is there any documentation on how to leverage the standard Apache.Avro
NuGet pkg to build a payload that contains the schema?
Azure Event Hub documentation fleetingly mentioned Avro, but any google search only really turns out Event Hub Capture..
Anyway in short.. is there a better way? I don't think i can send the schemas separately for this..