CommandGateway

Command Gateway interface for sending commands and waiting for their results.

The Command Gateway provides a high-level API for sending commands to aggregates and optionally waiting for their processing results. It supports various waiting strategies to control how long to wait and what stage of processing to wait for.

Author

ahoo wang

See also

Inheritors

Properties

Link copied to clipboard
open override val topicKind: TopicKind

The topic kind for command messages, always returns TopicKind.COMMAND

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
abstract fun receive(namedAggregates: Set<NamedAggregate>): Flux<ServerCommandExchange<*>>

Receives messages for the specified named aggregates.

Link copied to clipboard
abstract fun <C : Any> send(command: CommandMessage<C>, waitStrategy: WaitStrategy): Mono<out ClientCommandExchange<C>>

Sends a command message with a specified wait strategy.

abstract fun send(message: CommandMessage<*>): Mono<Void>

Sends a message through the message bus.

Link copied to clipboard
abstract fun <C : Any> sendAndWait(command: CommandMessage<C>, waitStrategy: WaitStrategy): Mono<CommandResult>

Sends a command and waits for the final result.

Link copied to clipboard

Sends a command and waits until it is fully processed by the aggregate.

Link copied to clipboard
open fun <C : Any> sendAndWaitForSent(command: CommandMessage<C>): Mono<CommandResult>

Sends a command and waits until it is successfully sent to the command bus.

Link copied to clipboard
open fun <C : Any> sendAndWaitForSnapshot(command: CommandMessage<C>): Mono<CommandResult>

Sends a command and waits until the aggregate state is snapshotted.

Link copied to clipboard
abstract fun <C : Any> sendAndWaitStream(command: CommandMessage<C>, waitStrategy: WaitStrategy): Flux<CommandResult>

Sends a command and returns a stream of command results as processing progresses.