Skip to main content

Leave Event Publishing Flow

Summary

Domain events become outbox messages immediately before EF persistence; relay publication and consumer work occur after commit.

Audience

Developers, QA, architects, messaging owners, and support engineers.

Concept

Invalid commands and rejected preconditions create no aggregate event. Request creation first commits request/history/outbox. An initial approval can then update balance in a second save. Direct decisions, cancellation, and Workflow decisions also save request state before the later balance update. Each save can therefore create a separate outbox message and an observable ordering gap.

Workflow start/callback operations are HTTP-based. A Workflow callback mutates the Leave aggregate and can produce ordinary approval/rejection events; there is no special Workflow integration event. External Attendance checks and Workflow calls occur outside the Leave database transaction.

Source References

  • microservices/src/leave-service/Infrastructure/LeaveDbContext.cs
  • microservices/src/leave-service/Application/LeaveWorkflows.cs
  • microservices/src/leave-service/Domain/Leave/LeaveRequest.cs
  • microservices/src/shared-kernel/Messaging/OutboxProcessor.cs
  • microservices/src/leave-service/Messaging/OutboxRelayHostedService.cs

See Also

Keywords

  • Publishing sequence
  • Transactional outbox
  • Multi-save workflow

Revision Information

  • Status: Draft
  • Last reviewed: 2026-07-15
  • Review cycle: Quarterly