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.

Functions

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.