ProjectionDispatcher

class ProjectionDispatcher(name: String, parallelism: Int = MessageParallelism.DEFAULT_PARALLELISM, domainEventBus: DomainEventBus, stateEventBus: StateEventBus, functionRegistrar: ProjectionFunctionRegistrar, eventHandler: ProjectionHandler, schedulerSupplier: AggregateSchedulerSupplier = DefaultAggregateSchedulerSupplier("ProjectionDispatcher")) : CompositeEventDispatcher

Dispatcher for projections that handles domain events and coordinates projection processing. This dispatcher extends CompositeEventDispatcher to provide event-driven processing for projections that transform domain events into read models or perform side effects.

Parameters

name

The name of the dispatcher, typically formatted as applicationName.ProjectionDispatcher.

parallelism

The number of parallel threads for processing messages (default: MessageParallelism.DEFAULT_PARALLELISM).

domainEventBus

The bus for publishing domain events.

stateEventBus

The bus for publishing state events.

functionRegistrar

The registrar for projection functions.

eventHandler

The handler for processing domain events.

schedulerSupplier

The supplier for aggregate schedulers (default: DefaultAggregateSchedulerSupplier with "ProjectionDispatcher" prefix).

Constructors

Link copied to clipboard
constructor(name: String, parallelism: Int = MessageParallelism.DEFAULT_PARALLELISM, domainEventBus: DomainEventBus, stateEventBus: StateEventBus, functionRegistrar: ProjectionFunctionRegistrar, eventHandler: ProjectionHandler, schedulerSupplier: AggregateSchedulerSupplier = DefaultAggregateSchedulerSupplier("ProjectionDispatcher"))

Properties

Link copied to clipboard
open override val name: String

The name of this dispatcher, typically formatted as applicationName.DomainEventDispatcher.

Functions

Link copied to clipboard
override fun forceStop()

Releases resources promptly without blocking, and remains safe before prepare and across repeated or overlapping calls.

Link copied to clipboard
override fun prepare(runtimeContext: RuntimeContext): Mono<Void>

Starts the composite event dispatcher by initializing and starting both the event stream dispatcher and state event dispatcher.

Link copied to clipboard
override fun quiesce()

Stops admitting new work after the runtime has atomically closed global admission.

Link copied to clipboard
override fun start()
Link copied to clipboard
override fun stopGracefully(): Mono<Void>

Stops the composite event dispatcher gracefully by stopping both the event stream dispatcher and state event dispatcher.