LocalFirstMessageBus

A message bus that prioritizes local message handling before distributed routing.

This bus first attempts to send messages locally within the JVM, and only sends to the distributed bus if local sending fails or there are no local subscribers. It also merges local and distributed message streams for receiving.

Parameters

M

The message type, must implement Message, NamedAggregate, and Copyable

E

The message exchange type

Inheritors

Properties

Link copied to clipboard

The distributed message bus for fallback routing.

Link copied to clipboard
abstract val localBus: LocalMessageBus<M, E>

The local message bus for in-JVM routing.

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 override fun receive(namedAggregates: Set<NamedAggregate>): Flux<E>

Receives messages from both local and distributed buses.

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

Sends a message using local-first routing strategy.