AggregateSnapshotDispatcher

class AggregateSnapshotDispatcher(val name: String = "-", val namedAggregate: NamedAggregate, val messageFlux: Flux<StateEventExchange<*>>, val parallelism: Int = MessageParallelism.DEFAULT_PARALLELISM, snapshotHandler: SnapshotHandler, val scheduler: Scheduler, messageReadiness: Mono<Void> = Mono.empty(), processingAdmission: () -> Unit = {}, processingQuiescence: () -> Unit = {}, metrics: WowMetrics = WowMetrics.NONE) : AggregateDispatcher<StateEventExchange<*>> , ProcessorInfo

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

Parameters

name

the name of this dispatcher (default: aggregateName-AggregateSnapshotDispatcher)

namedAggregate

the named aggregate this dispatcher handles

messageFlux

the flux of state event exchanges to process

parallelism

the number of parallel processing groups (default: MessageParallelism.DEFAULT_PARALLELISM)

snapshotHandler

the handler responsible for creating and storing snapshots

scheduler

the scheduler for processing messages

messageReadiness

completion of asynchronous message-source setup when this dispatcher is registered directly with a runtime

processingAdmission

explicit transport-processing gate opened by start

processingQuiescence

logical transport gate closed by quiesce

metrics

instance-scoped metrics recorder for dispatcher operations

Constructors

Link copied to clipboard
constructor(name: String = "-", namedAggregate: NamedAggregate, messageFlux: Flux<StateEventExchange<*>>, parallelism: Int = MessageParallelism.DEFAULT_PARALLELISM, snapshotHandler: SnapshotHandler, scheduler: Scheduler, messageReadiness: Mono<Void> = Mono.empty(), processingAdmission: () -> Unit = {}, processingQuiescence: () -> Unit = {}, metrics: WowMetrics = WowMetrics.NONE)

Properties

Link copied to clipboard
open override val contextName: String

The context name of the aggregate.

Link copied to clipboard
open override val messageFlux: Flux<StateEventExchange<*>>
Link copied to clipboard
open override val name: String
Link copied to clipboard
open override val namedAggregate: NamedAggregate
Link copied to clipboard
open override val parallelism: Int
Link copied to clipboard
open override val processorName: String

The processor name, set to SNAPSHOT_PROCESSOR_NAME.

Link copied to clipboard
open override val scheduler: Scheduler

Functions

Link copied to clipboard
open override fun handleExchange(exchange: StateEventExchange<*>): Mono<Void>

Handles a state event exchange by setting the snapshot function and delegating to the snapshot handler.

Link copied to clipboard
open override fun StateEventExchange<*>.toGroupKey(): Int

Computes the group key for parallel processing based on the message.