This is an example application demonstrating how to use Apache Kafka with Avro serialization/deserialization.
- Java 8 or higher installed
- Apache Kafka installed and running
- Schema Registry configured and running
- Clone this repository:
git clone https://github.com/robinhosz/kafka-avro-springboot.git
cd kafka-avro-springboot
To produce messages to the Kafka topic, send an HTTP POST request to the /api/produce
endpoint with a JSON message body:
Example request using cURL:
curl -X POST http://localhost:8181 -H 'Content-Type: application/json' -d '{ "id": "1", "firstname": "John", "lastName": "Doe", "email": "john.doe@example.com", "age": 30 }'
The produced messages can be consumed from the Kafka topic defined by the application. To view the consumed messages, check the application logs.