event-handler¶
Reaction to an Event that produces an externally observable side effect. See Concepts: Event Handler.
Fields¶
| Field | Required | Description |
|---|---|---|
apiVersion |
yes | schema.esdm.io/core/v1 |
kind |
yes | event-handler |
name |
yes | The Event Handler name. |
scope |
yes | scope.domain reference. |
deliveryGuarantee |
yes | at-least-once or at-most-once. |
idempotency |
required when deliveryGuarantee is at-least-once |
The idempotency strategy. |
handles |
yes | Non-empty list of Event references. |
sideEffects |
yes | Non-empty list of side effects the handler causes. |
constraints |
no | Named rules under which the handler runs. |
description |
no | Free-form prose. |
metadata |
no | Non-semantic labels and annotations. |
sideEffects[]¶
Each entry is one of two shapes:
type |
Required fields | Description |
|---|---|---|
external-call |
externalSystem, rule |
A call to a named External System. |
other |
rule |
Any observable effect that is not a third-party invocation (audit log, metric, cache invalidation). |
In both shapes, rule carries the prose description of the behavior.
Example¶
apiVersion: schema.esdm.io/core/v1
kind: event-handler
name: send-round-started-confirmation
scope:
domain: golf-club-management
deliveryGuarantee: at-least-once
idempotency:
strategy: deduplication-key
key: roundId
handles:
- boundedContext: round-play
aggregate: round
event: round-started
sideEffects:
- type: external-call
externalSystem: mailer
rule: Send the round-started confirmation email to the player.