DomainEventCompensator

Compensator for domain event streams.

This class handles compensation operations for domain events by resending event streams to the event bus with compensation metadata. It can compensate individual event streams or resend ranges of events from the event store.

Parameters

eventStore

The event store to use for loading events

eventBus

The event bus to use for sending compensated events

See also

Constructors

Link copied to clipboard
constructor(eventStore: EventStore, eventBus: DomainEventBus)

Creates a new DomainEventCompensator with the specified dependencies

Functions

Link copied to clipboard
open override fun compensate(eventStream: DomainEventStream, target: CompensationTarget): Mono<Void>

Compensates an event stream by marking it for compensation and resending.

open fun compensate(aggregateId: AggregateId, version: Int, target: CompensationTarget): Mono<Long>

Compensates events for the specified aggregate and version.

Link copied to clipboard
open override fun resend(aggregateId: AggregateId, headVersion: Int, tailVersion: Int, target: CompensationTarget): Mono<Long>

Resends a range of events from the event store with compensation.