RoutingEventStore

Routes operations to aggregate-specific stores and owns their lifecycle.

Closing the router closes every distinct registered store once.

Constructors

Link copied to clipboard
constructor(registry: AggregateEventStoreRegistry)

Functions

Link copied to clipboard
open override fun append(eventStream: DomainEventStream): Mono<Void>

Appends a domain event stream to the event store. Ensures transaction consistency and handles version conflicts.

Link copied to clipboard
open override fun close()

Closes this event store and releases owned resources.

Link copied to clipboard
open override fun existsRequestId(aggregateId: AggregateId, requestId: String): Mono<Boolean>

Checks whether the request ID already exists for the specified aggregate.

Link copied to clipboard
open override fun last(aggregateId: AggregateId): Mono<DomainEventStream>

Loads the last domain event stream for the specified aggregate.

Link copied to clipboard
open override fun load(aggregateId: AggregateId, headVersion: Int = DEFAULT_HEAD_VERSION, tailVersion: Int = DEFAULT_TAIL_VERSION): Flux<DomainEventStream>

Loads domain event streams for the specified aggregate within the given version range. The range is inclusive: headVersion, tailVersion.

open override fun load(aggregateId: AggregateId, headEventTime: Long, tailEventTime: Long): Flux<DomainEventStream>

Loads domain event streams for the specified aggregate within the given event time range. The range is inclusive: headEventTime, tailEventTime.

Link copied to clipboard

Wraps an EventStore with metrics collection capabilities. Returns a MetricEventStore that collects metrics on event storage operations. RoutingEventStore remains transparent because the selected leaf store owns storage metrics.

Link copied to clipboard
open override fun scanAggregateId(namedAggregate: NamedAggregate, afterId: String = FIRST_ID, limit: Int = 10): Flux<AggregateId>

Scans for aggregate IDs within the specified named aggregate, starting after the given ID. Returns a limited number of aggregate IDs in lexicographical order.

Link copied to clipboard
open override fun single(aggregateId: AggregateId, version: Int): Mono<DomainEventStream>

Loads a single domain event stream for the specified aggregate at the given version.