CompensationCommandHandler

Domain-specific compensation dispatcher used by SagaCompensationEngine.

Implementations dispatch on the typed TCommand (typically a Kotlin sealed interface mirroring the Avro tagged union) and invoke domain-level compensations (e.g. delete user, revert email update) — usually by delegating to an application-layer use case.

Strongly-typed by design — replaces the previous untyped Map<String, Any?> envelope and action: String discriminator with an exhaustive when on the sealed hierarchy.

Functions

Link copied to clipboard
abstract fun handle(sagaId: String, command: TCommand)

Performs the domain-specific compensation for a single event.