T - the type of messages this ReplyChannel deals withpublic class BufferingReplyChannel<T> extends Object implements ReplyChannel<T>
ReplyChannel implementation that uses a given buffer to buffer send, complete and
complete-with-error. ACKs and NACKs are delegated via delegate ReplyChannel.| Constructor and Description |
|---|
BufferingReplyChannel(ReplyChannel<T> delegate,
CloseableBuffer<T> buffer)
|
| 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 a receipt acknowledgement if one hasn't been sent yet for this instruction.
|
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. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitsendLast, sendNackpublic BufferingReplyChannel(ReplyChannel<T> delegate, CloseableBuffer<T> buffer)
delegate - used to delegate acks and nacksbuffer - used to buffer sends, completes and completes with errorpublic void send(T outboundMessage)
ReplyChanneloutboundMessage as a reply to an incoming instruction. Where possible, the instruction
identifiers should be set on the outbound message.send in interface ReplyChannel<T>outboundMessage - the message to sendpublic void sendAck()
ReplyChannelsendAck in interface ReplyChannel<T>ReplyChannel.complete()public void sendNack(ErrorMessage errorMessage)
ReplyChannelerrorMessage 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.sendNack in interface ReplyChannel<T>ReplyChannel.completeWithError(ErrorMessage),
ReplyChannel.completeWithError(ErrorCategory, String)public void complete()
ReplyChannelcomplete in interface ReplyChannel<T>public void completeWithError(ErrorMessage errorMessage)
ReplyChannelerrorMessage should provide
sufficient information about the error.completeWithError in interface ReplyChannel<T>errorMessage - the ErrorMessage describing the errorpublic void completeWithError(ErrorCategory errorCategory, String message)
ReplyChannelerrorCategory and message
should provide sufficient information about the error.completeWithError in interface ReplyChannel<T>errorCategory - the category that best described the error encounteredmessage - a message providing more details about the ErrorCopyright © 2020–2023 AxonIQ BV. All rights reserved.