LocalFirstDomainEventBus

Domain event bus that prioritizes local processing before distributed publishing.

This implementation extends LocalFirstMessageBus to provide a hybrid event bus that first processes events locally (for immediate consistency) and then publishes them to a distributed bus (for cross-service communication).

Parameters

distributedBus

The distributed event bus

localBus

The local event bus (default: InMemoryDomainEventBus)

See also

Constructors

Link copied to clipboard
constructor(distributedBus: DistributedDomainEventBus, localBus: LocalDomainEventBus = InMemoryDomainEventBus())

Creates a new LocalFirstDomainEventBus with the specified buses

Properties

Link copied to clipboard

The distributed event bus for cross-service communication

Link copied to clipboard
open override val localBus: LocalDomainEventBus

The local event bus for in-process handling (default: InMemoryDomainEventBus)

Link copied to clipboard
open override val topicKind: TopicKind

Functions

Link copied to clipboard
open override fun close()

Closes the message bus and releases any resources. Default implementation does nothing.

Link copied to clipboard
open fun receive(namedAggregates: Set<NamedAggregate>): Flux<EventStreamExchange>

Receives messages for the specified named aggregates.

Link copied to clipboard
open fun send(message: DomainEventStream): Mono<Void>

Sends a message through the message bus.