Simple example of how to use eventuate with Spring Boot.
This project consists of a couple of sub projects:
This is a Spring Boot service running on port 8080. It emits ComplaintCreated events and makes the them accessible using a simple REST API:
Request:
POST localhost:8080 {"company":"Accme", "description":"I am missing my [esc] key"}
Response:
{"id" : "69c13e8d-7c97-488e-afe1-b8377e8b3681", "company":"Acme", "description":"I am missing my [esc] key"}
Request:
GET localhost:8080
Response:
[ { "id" : "69c13e8d-7c97-488e-afe1-b8377e8b3681", "company" : "Accme", "description" : "I am missing my [esc] key"} }, { "id" : "c4d3367e-596b-43a4-ba0a-ae91f78641d1", "company" : "Black Hole", "description" : "Everything is so dark" } ]
Request:
GET localhost:8080/69c13e8d-7c97-488e-afe1-b8377e8b3681
Response:
{ "id" : "69c13e8d-7c97-488e-afe1-b8377e8b3681", "company":"Accme", "description":"I am missing my [esc] key" }
This is a Spring Boot service running on port 8081. It consumes ComplaintCreated events and calculates a simple metric on how many complaints exist for every given company and makes the metric accessible using a simple REST API:
Request:
GET localhost:8081
Response:
{ "Accme" : 1, "Black Hole" : 1 }