Kafka Schema Registry & Avro: Spring Boot Demo (2 of 2)

Rob Golder
Lydtech Consulting
Published in
6 min readNov 5, 2022

--

Kafka Schema Registry & Avro: Spring Boot Demo (2 of 2)

This is the second part of the in-depth look at the Kafka Schema Registry & Avro Spring Boot demo application. Part one provided an overview of the application and covered the process flow as an Avro serialized message is consumed and deserialized by the application, and a resulting outbound message is serialized using Avro and produced to Kafka. In this part the project structure and implementation are covered in detail.

The source code for the Spring Boot demo is available here:

https://github.com/lydtechconsulting/kafka-schema-registry-avro/tree/v1.0.0

Project Structure

The project is structured as a multi-module maven project, with the following modules:

  • avro-schema: contains the Avro message schema definitions
  • schema-registry-demo-service: the Spring Boot application
  • component-test: the component tests

Separating these into their own modules ensures a clean separation of concerns. The Avro generated classes are therefore built into a jar and pulled in as a dependency to the service. The component tests meanwhile treat the application as a black box, also pulling in the Avro generated classes in order to construct and send the events (and consume the…

--

--