DomainEventDispatcher

class DomainEventDispatcher(name: String, parallelism: Int = MessageParallelism.DEFAULT_PARALLELISM, domainEventBus: DomainEventBus, stateEventBus: StateEventBus, functionRegistrar: DomainEventFunctionRegistrar, eventHandler: DomainEventHandler, schedulerSupplier: AggregateSchedulerSupplier = DefaultAggregateSchedulerSupplier("EventDispatcher")) : CompositeEventDispatcher

Domain Event Dispatcher responsible for coordinating the processing of domain events.

This class extends AbstractEventDispatcher to provide concrete implementation for handling domain events through the event bus system. It manages the lifecycle of event processing, including subscription to event streams and distribution of events to appropriate handlers.

Parameters

name

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

parallelism

The level of parallelism for processing events (default: DEFAULT_PARALLELISM)

domainEventBus

The domain event bus for publishing and subscribing to domain events

stateEventBus

The state event bus for handling state-related events

functionRegistrar

The registrar for domain event handler functions

eventHandler

The event handler for processing domain events

schedulerSupplier

Supplier for creating schedulers for aggregate processing

See also

Constructors

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

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.