Package-level declarations

Types

Link copied to clipboard
class AggregateSnapshotDispatcher(snapshotHandler: SnapshotHandler, val namedAggregate: NamedAggregate, val name: String = "-", val parallelism: Int = MessageParallelism.DEFAULT_PARALLELISM, val scheduler: Scheduler, val messageFlux: Flux<StateEventExchange<*>>) : AggregateMessageDispatcher<StateEventExchange<*>> , ProcessorInfo

Dispatcher for handling snapshot operations on state events for a specific aggregate. Routes state event exchanges to the snapshot handler for processing.

Link copied to clipboard
Link copied to clipboard

In-memory implementation of SnapshotRepository for testing and development. Stores snapshots as JSON strings in a thread-safe map.

Link copied to clipboard

No-operation implementation of SnapshotRepository that does nothing. Useful for testing or when snapshots are not needed.

Link copied to clipboard
data class SimpleSnapshot<S : Any>(val delegate: ReadOnlyStateAggregate<S>, val snapshotTime: Long = System.currentTimeMillis()) : Snapshot<S> , ReadOnlyStateAggregate<S> , Decorator<ReadOnlyStateAggregate<S>>

Simple implementation of Snapshot that wraps a ReadOnlyStateAggregate with a snapshot time.

Link copied to clipboard

Simple implementation of SnapshotStrategy that creates a snapshot for every state event. This strategy saves a snapshot immediately after each state event is processed.

Link copied to clipboard

Represents a snapshot of a state aggregate at a specific point in time. Snapshots are used to optimize loading by providing a starting point for event replay.

Link copied to clipboard
class SnapshotDispatcher(val name: String, val namedAggregates: Set<NamedAggregate> = MetadataSearcher.namedAggregateType.keys.toSet(), snapshotHandler: SnapshotHandler, stateEventBus: StateEventBus, parallelism: Int = MessageParallelism.DEFAULT_PARALLELISM, schedulerSupplier: AggregateSchedulerSupplier = DefaultAggregateSchedulerSupplier(SNAPSHOT_PROCESSOR_NAME)) : AbstractDispatcher<StateEventExchange<*>> , MessageDispatcher
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Repository for storing and retrieving snapshots of state aggregates. Snapshots optimize aggregate loading by providing a recent state checkpoint.

Link copied to clipboard

Strategy for managing snapshots of state aggregates. Snapshot strategies determine when and how to create snapshots based on state events. This helps optimize aggregate loading by reducing the number of events that need to be replayed.

Link copied to clipboard
class VersionOffsetSnapshotStrategy(versionOffset: Int = DEFAULT_VERSION_OFFSET, snapshotRepository: SnapshotRepository) : SnapshotStrategy

Snapshot strategy that creates snapshots based on version offset. A snapshot is created when the current aggregate version exceeds the last snapshot version by the specified offset. This helps balance between snapshot frequency and storage efficiency.

Properties

Link copied to clipboard

Default version offset for snapshot creation. Snapshots are created when the version difference reaches this threshold.

Link copied to clipboard

Functions

Link copied to clipboard
fun <S : Any, D : Any> Snapshot<S>.materialize(materialize: (S) -> D): MaterializedSnapshot<D>
Link copied to clipboard
Link copied to clipboard