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. |
default void |
sendAck()
Deprecated.
This method is deprecated because it is not needed anymore, as the
complete() already sends
positive result, indicating that the incoming message has been handled as expected. |
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()
Deprecated.
This method is deprecated because it is not needed anymore, as
completeWithError(ErrorMessage)
or completeWithError(ErrorCategory, String) sends a failed result, indicating that the incoming message
could not be handled as expected. |
default void |
sendNack(ErrorMessage errorMessage)
Deprecated.
This method is deprecated because it is not needed anymore, as
completeWithError(ErrorMessage)
or completeWithError(ErrorCategory, String) already sends a failed result, indicating that the incoming
message could not be handled as expected. |
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.
@Deprecated default void sendAck()
complete() already sends
positive result, indicating that the incoming message has been handled as expected.complete()@Deprecated default void sendNack()
completeWithError(ErrorMessage)
or completeWithError(ErrorCategory, String) sends a failed result, indicating that the incoming message
could not be handled as expected.sendNack(ErrorMessage), no specific error details are provided.
If the incoming instruction has no instruction ID, this method does nothing.@Deprecated default void sendNack(ErrorMessage errorMessage)
completeWithError(ErrorMessage)
or completeWithError(ErrorCategory, String) already sends a failed result, indicating that the incoming
message could not be handled as expected.errorMessage to describe the reason. 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–2022 AxonIQ BV. All rights reserved.