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 plans to control how long to wait and what stage of processing to wait for. Implementations that report enforcesCommandWaitTimeout must enforce WaitPlan.timeout as an end-to-end deadline for sendAndWait and sendAndWaitStream.

Author

ahoo wang

See also

Inheritors

Properties

Link copied to clipboard

Whether this gateway enforces WaitPlan.timeout itself.

Link copied to clipboard
open override val topicKind: TopicKind

The topic kind for command messages.

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(subscription: MessageSubscription): Flux<ServerCommandExchange<*>>

Receives messages for the specified subscription.

Link copied to clipboard

Creates a single message source with an explicit transport readiness boundary.

Link copied to clipboard

Creates the message source owned by a me.ahoo.wow.runtime.WowRuntime dispatcher.

Link copied to clipboard
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>, waitPlan: WaitPlan): 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>, waitPlan: WaitPlan): Flux<CommandResult>

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