This example demonstrates spring-kafka using request-reply semantics.
- Java 11+
- Maven 3+
- Apache Kafka
- Lombok
- Docker Compose (optional but preferred)
To start this app:
- Start kafka with compose 'docker-compose up'
- Start server running './mvnw spring-boot:run'
Open you console and enter command below:
curl -X POST http://localhost:8080/coffee/create -d '{"varietal": "Yellow Bourbon","quantity": 5, "price": 30.00}' -H "Content-Type: application/json" | python -m json.tool
Response:
{
"id": "34ff3987-aa3f-4e8b-8d92-f43d80849e6c",
"price": 30.0,
"varietal": "Yellow Bourbon",
"quantity": 5,
"amount": 150.0
}
curl -X GET http://localhost:8080/monitoring -H "Content-Type: application/json" | python -m json.tool