sendAndWait

open override fun <C : Any> sendAndWait(command: CommandMessage<C>, waitStrategy: WaitStrategy): Mono<CommandResult>

Sends a command and waits for the final result. Throws CommandResultException if the command execution fails.

Return

A Mono emitting the final CommandResult.

Parameters

command

The command message to send.

waitStrategy

The strategy defining how and what to wait for.

Type Parameters

C

The type of the command body.

Throws

if the command is not idempotent.

jakarta.validation.ConstraintViolationException

if validation fails.

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

if the command execution fails.