To help you with using Avro as the serialization format for your Kafka messages, a .NET core global tool avrogen is available.
- First install the tool using dotnet tool install:
- Next step is to specify your message schema. Therefore you need to create an .avsc file and add your message specification:
- Now it’s time to generate the necessary code:
- This will generate the following:
The generated type can than be used by your Producer and Consumer logic.
More information: https://www.confluent.io/blog/avro-kafka-data/