Spring Boot — publish Kafka messages

theoneamin
3 min readJun 3, 2022

In this article, we’ll take a look at how to send messages to a Kafka topic using a REST application. We’ll also look at how to serialize an object so we can send it as a message. Be sure to have Kafka running as this article will not go into how to set that up.

New project

Below are the dependencies I’m using.

Producer

--

--