Package io.axoniq.axonserver.connector
Interface ReplyChannel<T>
-
- Type Parameters:
T- the type of message expected on thisReplyChannel
- All Known Implementing Classes:
BufferingReplyChannel,CloseAwareReplyChannel,ForwardingReplyChannel
public interface ReplyChannel<T>Interface providing access to the communication channel to send replies to incoming instructions. All instructions must be acknowledged by completing the reply channel after successfully sending all necessary replies.One should not send messages after completing the reply channel. The behavior is such a case is undefined.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description voidcomplete()Marks the inbound instruction as completed.voidcompleteWithError(ErrorCategory errorCategory, String message)Marks the inbound instruction as exceptionally completed.voidcompleteWithError(ErrorMessage errorMessage)Marks the inbound instruction as exceptionally completed.voidsend(T outboundMessage)Sends the givenoutboundMessageas a reply to an incoming instruction.default voidsendAck()Deprecated.This method is deprecated because it is not needed anymore, as thecomplete()already sends positive result, indicating that the incoming message has been handled as expected.default voidsendLast(T outboundMessage)Sends the givenresponseand marks the processing as completed, possibly signalling flow control that more query messages may be sent.default voidsendNack()Deprecated.This method is deprecated because it is not needed anymore, ascompleteWithError(ErrorMessage)orcompleteWithError(ErrorCategory, String)sends a failed result, indicating that the incoming message could not be handled as expected.default voidsendNack(ErrorMessage errorMessage)Deprecated.This method is deprecated because it is not needed anymore, ascompleteWithError(ErrorMessage)orcompleteWithError(ErrorCategory, String)already sends a failed result, indicating that the incoming message could not be handled as expected.
-
-
-
Method Detail
-
send
void send(T outboundMessage)
Sends the givenoutboundMessageas a reply to an incoming instruction. Where possible, the instruction identifiers should be set on the outbound message.- Parameters:
outboundMessage- the message to send- Implementation Note:
- Implementations are encouraged to validate and correct these instruction identifiers.
-
sendLast
default void sendLast(T outboundMessage)
Sends the givenresponseand 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.
-
sendAck
@Deprecated default void sendAck()
Deprecated.This method is deprecated because it is not needed anymore, as thecomplete()already sends positive result, indicating that the incoming message has been handled as expected.Sends a receipt acknowledgement if one hasn't been sent yet for this instruction. If the incoming instruction has no instruction ID, this method does nothing.- See Also:
complete()
-
sendNack
@Deprecated default void sendNack()
Deprecated.This method is deprecated because it is not needed anymore, ascompleteWithError(ErrorMessage)orcompleteWithError(ErrorCategory, String)sends a failed result, indicating that the incoming message could not be handled as expected.Sends a negative acknowledgement, indicating that the incoming message could not be handled as expected. UnlikesendNack(ErrorMessage), no specific error details are provided. If the incoming instruction has no instruction ID, this method does nothing.
-
sendNack
@Deprecated default void sendNack(ErrorMessage errorMessage)
Deprecated.This method is deprecated because it is not needed anymore, ascompleteWithError(ErrorMessage)orcompleteWithError(ErrorCategory, String)already sends a failed result, indicating that the incoming message could not be handled as expected.Sends a negative acknowledgement, indicating that the incoming message could not be handled as expected, using givenerrorMessageto describe the reason. The givenerrorMessageshould provide sufficient information about the error. If the incoming instruction has no instruction ID, this method does nothing.
-
complete
void complete()
Marks the inbound instruction as completed.
-
completeWithError
void completeWithError(ErrorMessage errorMessage)
Marks the inbound instruction as exceptionally completed. The givenerrorMessageshould provide sufficient information about the error.- Parameters:
errorMessage- the ErrorMessage describing the error
-
completeWithError
void completeWithError(ErrorCategory errorCategory, String message)
Marks the inbound instruction as exceptionally completed. The givenerrorCategoryandmessageshould provide sufficient information about the error.- Parameters:
errorCategory- the category that best described the error encounteredmessage- a message providing more details about the Error
-
-