Spring Boot Project using Kafka and R2DBC (Part V)
Now we can create the event/messaging classes.
But before that we need to make some settings in the application.yml file:
AVRO Schemas
First of all, we need to create the .avsc files in src/main/avro folder:
The MeasurementCollected event:
The MeasurementAnalyzed schema:
Mapper Classes
Let’s create the mapper classes:
The MeasurementConsumerMapper class:
The MeasurementProducerMapper class:
Consumer Class
Now, let’s create the consumer class:
Producer Class
Finally, let’s create the producer class:
Topic Property class:
In order to become easy the management of topics we can create the following class: