Skip to main content

Employee Event Overview

Summary

The Employee event model separates in-process aggregate facts from shared cross-service contracts and uses an outbox boundary between persistence and broker publication.

Audience

  • Developers, architects, QA engineers, and service operators

Overview

The aggregate raises domain events after confirmed state transitions. During SaveChangesAsync, infrastructure maps supported domain events into shared integration-event records and adds serialized messages to the same EF Core unit of work. A shared event bus can publish staged messages. Employee Service does not register a background relay, so continuous forwarding from its outbox is not confirmed.

Architecture

LayerConfirmed responsibilityMaturity
DomainRaise facts from aggregate methodsFoundation
Infrastructure mappingTranslate all seven Employee domain-event typesFoundation
Contract assemblyDefine versioned shared recordsFoundation
OutboxPersist pending messages with aggregate changesFoundation
RelayShared processor exists; Employee invocation absentRequires confirmation
ConsumersSix services reference at least one Employee eventTransitional

Contract boundary

Domain events are internal implementation facts. Integration events are shared serialized records. A matching name does not make the two types interchangeable; infrastructure explicitly creates a new integration-event identifier and supplies contract metadata.

Confirmed limitations

  • No Employee Service hosted relay or scheduled call to IOutboxProcessor.ProcessPendingAsync was found.
  • No consumer was found for EmployeeDeleted, ManagerChanged, DepartmentChanged, or EmployeeTimelineEventRecorded.
  • Delivery guarantees beyond the implemented durable-message, acknowledgement, and requeue behavior Require confirmation.
  • No approved deprecation or compatibility policy was found for Employee event contracts.

Source References

  • microservices/src/employee-service/Domain/Employees/Employee.cs
  • microservices/src/employee-service/Infrastructure/EmployeeDbContext.cs
  • microservices/src/employee-service/Program.cs
  • microservices/src/shared-kernel/Extensions/MessagingExtensions.cs
  • microservices/src/shared-kernel/Messaging/OutboxProcessor.cs

See Also

Keywords

  • Event architecture
  • Domain-to-integration boundary
  • Delivery maturity

Revision Information

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