- Java
- Postgres
- RabbitMQ
- MongoDB
Write database (Postgres)
# start postgres on default port, then:
createdb cqrsexample
psql cqrsexample -f server/productscommand/src/main/resources/sql/schema.sql
Read database (MongoDB)
# start mongodb on default port, then in the mongo console:
use cqrsexample
db.createCollection("products")
Message Queue (RabbitMQ)
# start rabbitmq on default port
Command Microservice (Spring Boot)
cd server/productscommand
./gradlew build
Query Microservice (Spring Boot)
cd server/productsquery
./gradlew build
Command Microservice
cd server/productscommand
./gradlew test
Query Microservice
cd server/productsquery
./gradlew test
Command Microservice (localhost:8080)
cd server/productscommand
./gradlew bootrun
Query Microservice (localhost:8081)
cd server/productsquery
./gradlew bootrun
This is proof of concept, and not production ready. Remaining issues to address include:
- No exception handling, so dropped messages result in out-of-syn view database
- No event store, so reproducing view database from zero is difficult