This project is a MVP for creating accounts using Spring boot reactive app with MongoDB & Kafka
You can configure the connection to MongoDB & Kafka on application.properties file or use docker-compose to run them locally. Then you can start the server with the following command:
./mvnw spring-boot:run
You can package the Spring server by doing:
./mvnw clean package
You can run kafka & mongoDB with docker-compose:
docker-compose up -d
You can use Kafka console consumer to observe records in the topic
docker exec -it kafka ./opt/bitnami/kafka/bin/kafka-console-consumer.sh --bootstrap-server localhost:9092 --topic account --from-beginning
Get all accounts:
curl reactive:8081/account/
Get an accounts with id = 256479:
curl reactive:8081/account/256479
Create account:
curl -X POST -H "Content-Type: application/json" -d "{\"id\":\"4748\",\"owner\":\"Toto\",\"value\":\"7.54\"}" reactive:8081/account/add
{"id":"4748","owner":"Toto","value":7.54}