ProjectionDispatcher

class ProjectionDispatcher(val name: String, val parallelism: Int = MessageParallelism.DEFAULT_PARALLELISM, val domainEventBus: DomainEventBus, val stateEventBus: StateEventBus, val functionRegistrar: ProjectionFunctionRegistrar, val eventHandler: ProjectionHandler, schedulerSupplier: AggregateSchedulerSupplier = DefaultAggregateSchedulerSupplier("ProjectionDispatcher")) : AbstractEventDispatcher<Mono<*>>

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

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 domainEventBus: DomainEventBus

The bus for publishing domain events.

Link copied to clipboard
open override val eventHandler: ProjectionHandler

The handler for processing domain events.

Link copied to clipboard

The registrar for projection functions.

Link copied to clipboard
open override val name: String

named like applicationName.ProjectionDispatcher

Link copied to clipboard
open override val parallelism: Int

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

Link copied to clipboard
open override val stateEventBus: StateEventBus

The bus for publishing state events.

Functions

Link copied to clipboard
open override fun close()

Closes the event dispatcher and cancels all subscriptions.

Link copied to clipboard
open override fun run()

Starts the event dispatcher by subscribing to event streams.