T - the type of message expected on this ReplyChannelpublic interface ReplyChannel<T>
One should not send messages after completing the reply channel. The behavior is such a case is undefined.
| Modifier and Type | Method and Description |
|---|---|
void |
complete()
Marks the inbound instruction as completed.
|
void |
completeWithError(ErrorCategory errorCategory,
String message)
Marks the inbound instruction as exceptionally completed.
|
void |
completeWithError(ErrorMessage errorMessage)
Marks the inbound instruction as exceptionally completed.
|
void |
send(T outboundMessage)
Sends the given
outboundMessage as a reply to an incoming instruction. |
void |
sendAck()
Sends an receipt acknowledgement if one hasn't been sent yet for this instruction.
|
default void |
sendLast(T outboundMessage)
Sends the given
response and marks the processing as completed, possibly signalling flow control that
more query messages may be sent. |
default void |
sendNack()
Sends a negative acknowledgement, indicating that the incoming message could not be handled as expected.
|
void |
sendNack(ErrorMessage errorMessage)
Sends a negative acknowledgement, indicating that the incoming message could not be handled as expected, using
given
errorMessage to describe the reason. |
void send(T outboundMessage)
outboundMessage as a reply to an incoming instruction. Where possible, the instruction
identifiers should be set on the outbound message.outboundMessage - the message to senddefault void sendLast(T outboundMessage)
response and marks the processing as completed, possibly signalling flow control that
more query messages may be sent.
No more responses should be sent after invoking this method. The behavior in that case is undefined, and these messages are likely to be ignored.
void sendAck()
complete() method is invoked.
If the incoming instruction has no instruction ID, this method does nothing.
default void sendNack()
sendNack(ErrorMessage), no specific error details are provided. If not explicitly sent, it will be send
once the completeWithError(ErrorMessage) or completeWithError(ErrorCategory, String) methods
are invoked.
If the incoming instruction has no instruction ID, this method does nothing.
sendNack(ErrorMessage)void sendNack(ErrorMessage errorMessage)
errorMessage to describe the reason. If not explicitly sent, it will be send once the completeWithError(ErrorMessage) or completeWithError(ErrorCategory, String) methods are invoked. The
given errorMessage should provide sufficient information about the error.
If the incoming instruction has no instruction ID, this method does nothing.
void complete()
void completeWithError(ErrorMessage errorMessage)
errorMessage should provide
sufficient information about the error.errorMessage - the ErrorMessage describing the errorvoid completeWithError(ErrorCategory errorCategory, String message)
errorCategory and message
should provide sufficient information about the error.errorCategory - the category that best described the error encounteredmessage - a message providing more details about the ErrorCopyright © 2020–2021 AxonIQ BV. All rights reserved.