The events are schemed and serialised using protocol buffers. The events schemas can be found in /schema/protobufs/stocklet/events/
They are dispatched using the transactional outbox pattern. Debezium is used as a relay to publish events from database outbox tables to the message broker (Kafka). The Debezium connectors are configured by the service-init
containers, which are also responsible for performing database migrations for their respective services.
Produces:
- n/a
Consumes:
- UserDeletedEvent
Produces:
- OrderCreatedEvent
- OrderPendingEvent
- OrderRejectedEvent
- OrderApprovedEvent
Consumes:
- ProductPriceQuoteEvent
- StockReservationEvent
- ShipmentAllocationEvent
- PaymentProcessedEvent
Produces:
- BalanceCreatedEvent
- BalanceCreditedEvent
- BalanceDebitedEvent
- BalanceClosedEvent
- TransactionLoggedEvent
- TransactionReversedEvent (currently unused)
- PaymentProcessedEvent
Consumes:
- UserCreatedEvent
- UserDeletedEvent
- ShipmentAllocationEvent
Produces:
- ProductCreatedEvent
- ProductPriceUpdatedEvent
- ProductDeletedEvent
- ProductPriceQuoteEvent
Consumes:
- OrderCreatedEvent
Produces:
- ShipmentAllocationEvent
- ShipmentDispatchedEvent (currently unused)
Consumes:
- StockReservationEvent
- PaymentProcessedEvent
Produces:
- UserCreatedEvent
- UserEmailUpdatedEvent
- UserDeletedEvent
Consumes:
- n/a
Produces:
- StockCreatedEvent
- StockAddedEvent (currently unused)
- StockRemovedEvent
- StockReservationEvent
Consumes:
- OrderPendingEvent
- ShipmentAllocationEvent
- PaymentProcessedEvent
The place order saga is initiated when a new order is created.