Interface MessageObservation
- All Known Implementing Classes:
DefaultMessageObservation
public interface MessageObservation
The message observation contract
-
Method Summary
Modifier and TypeMethodDescriptionlonglongbooleanisDone()voidonMessageAck(Message<?> message) Notify the observation of acknowledgement eventvoidonMessageNack(Message<?> message, Throwable reason) Notify the observation of negative acknowledgement event
-
Method Details
-
getChannel
String getChannel()- Returns:
- the channel name of the message
-
getCreationTime
long getCreationTime()- Returns:
- the creation time of the message in system nanos
-
getCompletionTime
long getCompletionTime()- Returns:
- the completion time of the message in system nanos
-
getCompletionDuration
Duration getCompletionDuration()- Returns:
- the duration between creation and the completion time, null if message processing is not completed
-
isDone
boolean isDone()- Returns:
trueif the message processing is completed with acknowledgement or negative acknowledgement
-
getReason
Throwable getReason()- Returns:
- the negative acknowledgement reason
-
onMessageAck
Notify the observation of acknowledgement event -
onMessageNack
Notify the observation of negative acknowledgement event- Parameters:
reason- the reason of the negative acknowledgement
-