Spring Boot Project using Kafka and R2DBC (Part V)

Gabriel Martins
Apr 30, 2021

--

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:

Related Links

Previous Tutorial: Tutorial Part IV

Next Tutorial: Tutorial Part VI

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

Gabriel Martins
Gabriel Martins

Written by Gabriel Martins

Just a brazilian guy who loves technology and wants to share the experiences he has learned

No responses yet