Skip to content

A POC for order status dealing using event sourcing, and add on other cool thing

Notifications You must be signed in to change notification settings

NoahHsu/event-sourcing-order-poc

Repository files navigation

Event Sourcing Order P.O.C

Event Stream

event storm result

Code Structure

Dependency Services

  • Kafka: Event Store & Event Bus

Domain Aggregate

  • Order
  • Payment
  • Shipment

Server Role

  • Command-Side:
    • handle command request
    • write events to Kafka
  • Query-Side:
    • consume events from Kafka to build data view
    • return query request
  • Event-Handler
    • consume events from Kafka to send command request to Command-side

How to run application

The dependency container will run in the docker by spring-boot-docker-support so you can run the App by IDE directly.

Run E2E test in local

prerequisite

command

  • for mac with M2 chip
act -j e2e-test --container-architecture linux/amd64
  • for normal linux based kernel
act -j e2e-test

Endpoint

server swagger url
Order Command https://localhost:8081/swagger-ui/index.html
Order Handler https://localhost:8082/swagger-ui/index.html
Order Query https://localhost:8083/swagger-ui/index.html
Payment Command https://localhost:9081/swagger-ui/index.html
Payment Handler https://localhost:9082/swagger-ui/index.html
Payment Query https://localhost:9083/swagger-ui/index.html
Shipment Command https://localhost:10081/swagger-ui/index.html
Shipment Handler https://localhost:10082/swagger-ui/index.html
Shipment Query https://localhost:10083/swagger-ui/index.html
Grafana https://localhost:3200
Prometheus https://localhost:9090

About

A POC for order status dealing using event sourcing, and add on other cool thing

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages