- Apache Kafka 2.13-2.7.0
- Java 8
- spring-boot 2.43
Inside the kafka directory run:
bin/kafka-topics.sh --create --topic novice-players --bootstrap-server localhost:9092
Inside the root source directory run:
mvn spring-boot:run
In a new shell run:
curl -X POST "http://localhost:8080/players/" -H "accept: application/json" -H "Content-Type: application/json" -d "{\"players\":[{\"name\":\"Sub zero\",\"type\":\"expert\"},{\"name\":\"Scorpion\",\"type\":\"novice\"},{\"name\":\"Reptile\",\"type\":\"meh\"}]}"
Or in a web browser use the swagger interface:
Inside the kafka directory run:
bin/kafka-console-consumer.sh --topic novice-players --from-beginning --bootstrap-server localhost:9092