Interface Acknowledgeable
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceA listener that is notified when an acknowledgement or negative acknowledgement is complete. -
Method Summary
Modifier and TypeMethodDescriptionvoidack(Acknowledgeable.AcknowledgementListener listener) Acknowledge this object.voidnack(Acknowledgeable.AcknowledgementListener listener) Negatively acknowledge this object.
-
Method Details
-
ack
Acknowledge this object. Generally used to indicate that the message has been processed successfully and can safely be removed from its respective source.This method guarantees that the given listener will be called exactly once, with either
successorfailure.This operation is idempotent, meaning that calling it multiple times will have the same effect as calling it once.
This method is mutually exclusive with
nack, meaning that if this method is called, then a subsequent call to the nack method should fail.- Parameters:
listener- the listener to notify when the acknowledgement is complete, either successfully or with an error.
-
nack
Negatively acknowledge this object. Generally used to indicate that there was an error processing the message, and it should be retried according to the semantics of its respective source.This method guarantees that the given listener will be called exactly once, with either
successorfailure.This operation is idempotent, meaning that calling it multiple times will have the same effect as calling it once.
This method is mutually exclusive with
ack, meaning that if this method is called, then a subsequent call to the ack method should fail.- Parameters:
listener- the listener to notify when the negative acknowledgement is complete, either successfully or with an error.
-