Skip to content

Latest commit

 

History

History

Sample.Serialization.MessagesAvro

What

This shows the Avro IDL contract first approach using the Apache.Avro library. First we need to define the IDL (*.avdl), then we generate C# classes from it.

  • The Avro contract is defined in Avro IDL (*.avdl).
  • Then it is transformed into the Avro Protocol (*.avpr) - using the java tool.
  • Then we generated C# classes - using the dotnet avro tool.

Prerequisites

  1. Install Avro dotnet tools for code generation:
dotnet tool install -g Apache.Avro.Tools
  1. Install Java SDK (1.8).

Usage

In PowerShell:

cd Tools
.\gen.ps1

C# classes and *.avpr files are generated from the *.avdl files.