send

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

Sends a command message through the command bus after performing validation and idempotency checks. Notifies wait strategies if configured in the message header.

Return

A Mono that completes when the command is successfully sent.

Parameters

message

The command message to send.

Throws

if the command is not idempotent.

ConstraintViolationException

if validation fails.


open override fun <C : Any> send(command: CommandMessage<C>, waitStrategy: WaitStrategy): Mono<out ClientCommandExchange<C>>

Sends a command with a specific wait strategy and returns a command exchange for tracking. This method handles wait strategy registration, propagation, and cleanup.

Return

A Mono emitting a ClientCommandExchange for tracking the command execution.

Parameters

C

The type of the command body.

command

The command message to send.

waitStrategy

The strategy defining how and what to wait for.

Throws

if the command is not idempotent.

ConstraintViolationException

if validation fails.

if the wait strategy doesn't support void commands when needed.

Samples