This project demonstrates on how to set-up CQRS in a Spring Boot application using AxonIQ.
This sample project is based on Master Spring Boot Microservices with CQRS and Event Sourcing udemy course.
There are 5 services in this demo:
- Api Gateway
- User Command API
- User Query API
- Bank Command API
- Bank Query API
User Command API & User Command Query services
Bank Command API & Bank Command Query services
- Clone this repository
git clone https://github.com/guedim/spring-projects.git
- Move to the directory
cqrs-axon/user-management
cd spring-projects/cqrs-azon/user-management
- To build all services docker images (mongo, axon, mysql, user, bank, apigateway, etc,) run next command:
docker-compose build
For create, start and attach all containers, please run next docker-compose command:
docker-compose up
Finally, for running services import collection file cqrs-axon.postman_collection.json into Postman application.
- Commands: Post Commands for user and bank services.
- Query: Post Queries for user and bank services.
- AuthServer: Authorization server for generate token. (Automatically called by Postman)
- ApiGateway: Samples for Post Commands and Queries using api gateway project.