A small Java SpringBoot based application using Kafka to produce and consume a message with JSON payload.
Install Confluent CLI from here: https://docs.confluent.io/confluent-cli/current/install.html
confluent local kafka start
Take note of the port used by Kafka broker as it starts up. The output will be on this form:
+-----------------+-------+
| Kafka REST Port | 8082 |
| Plaintext Ports | 62082 |
+-----------------+-------+
First modify src/main/resources/applicatipn.properties
with correct port
Then start application
./gradlew bootRun
The application has a REST API to publish messages.
curl -XPOST "https://localhost:8080/send?message=test"
The output from the application will list received messages.