EventStoreStateAggregateRepository

Repository for loading state aggregates directly from the event store without snapshots. Always starts from an empty state and replays all relevant events.

Author

ahoo wang

Parameters

stateAggregateFactory

factory for creating state aggregates

eventStore

store for loading event streams

Constructors

Link copied to clipboard
constructor(stateAggregateFactory: StateAggregateFactory, eventStore: EventStore)

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
open override fun <S : Any> load(aggregateId: AggregateId, metadata: StateAggregateMetadata<S>, tailVersion: Int): Mono<StateAggregate<S>>

Loads a state aggregate by replaying events up to the specified version. Starts from an empty state and applies all events from the expected next version.

open override fun <S : Any> load(aggregateId: AggregateId, metadata: StateAggregateMetadata<S>, tailEventTime: Long): Mono<StateAggregate<S>>

Loads a state aggregate by replaying events up to the specified event time. Starts from an empty state and applies all events from the next event time.