Skip to content

This example demonstrates spring boot and kafka using request-reply semantics.

Notifications You must be signed in to change notification settings

jorgeavelar/spring-kafka-request-reply

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Synchronous Request-Reply with Spring Boot and Kafka

This example demonstrates spring-kafka using request-reply semantics.

Requirements

  • Java 11+
  • Maven 3+
  • Apache Kafka
  • Lombok
  • Docker Compose (optional but preferred)

Running

To start this app:

  • Start kafka with compose 'docker-compose up'
  • Start server running './mvnw spring-boot:run'

How to test

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
}

Monitoring application:

curl -X GET http://localhost:8080/monitoring -H "Content-Type: application/json" | python -m json.tool

Maintainers

Jorge Avelar

About

This example demonstrates spring boot and kafka using request-reply semantics.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages