2. @crichardson
About the example
Demonstrates two key patterns:
Sagas - implement transactions that span services, https://
microservices.io/patterns/data/saga.html
CQRS - implement queries that retrieve data from multiple
services, https://microservices.io/patterns/data/cqrs.html
Built using Spring Boot, JPA and the Eventuate Tram
framework
https://github.com/eventuate-tram/eventuate-tram-examples-customers-and-orders/
Note: this presentation describes the development branch , which
reorganized/renamed the service modules.
These changes will soon be merged into master
13. @crichardson
Using the Saga pattern
Customer has a credit limit
createOrder()
Creates Order
Reserves credit
cancelOrder()
Updates Order
Releases credit
Event-driven
a.k.a
Choreography-based sagas
https://microservices.io/patterns/data/saga.html
14. Using the CQRS pattern
findOrderHistory()
Returns customers and
their orders
Order History Service
uses events to maintain a
replica in MongoDB
https://microservices.io/patterns/data/cqrs.html
16. Customer Service - code
customer-service-api-
messaging - events
published by the service
customer-service-api-web
- DTOs for REST
resources
customer-service - service
implementation
18. Order Service - code
order-service-api-
messaging - events
published by the service
order-service-api-web -
DTOs for REST requests
and responses
order-service - service
implementation