Class DefaultMessageObservation
java.lang.Object
io.smallrye.reactive.messaging.observation.DefaultMessageObservation
- All Implemented Interfaces:
MessageObservation
The default implementation based on system nano time.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionDefaultMessageObservation(String channelName) DefaultMessageObservation(String channelName, long creationTime) -
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
-
Field Details
-
completion
protected volatile long completion -
done
protected volatile boolean done -
nackReason
-
-
Constructor Details
-
DefaultMessageObservation
-
DefaultMessageObservation
-
-
Method Details
-
getChannel
- Specified by:
getChannelin interfaceMessageObservation- Returns:
- the channel name of the message
-
getCreationTime
public long getCreationTime()- Specified by:
getCreationTimein interfaceMessageObservation- Returns:
- the creation time of the message in system nanos
-
getCompletionTime
public long getCompletionTime()- Specified by:
getCompletionTimein interfaceMessageObservation- Returns:
- the completion time of the message in system nanos
-
isDone
public boolean isDone()- Specified by:
isDonein interfaceMessageObservation- Returns:
trueif the message processing is completed with acknowledgement or negative acknowledgement
-
getReason
- Specified by:
getReasonin interfaceMessageObservation- Returns:
- the negative acknowledgement reason
-
getCompletionDuration
- Specified by:
getCompletionDurationin interfaceMessageObservation- Returns:
- the duration between creation and the completion time, null if message processing is not completed
-
onMessageAck
Description copied from interface:MessageObservationNotify the observation of acknowledgement event- Specified by:
onMessageAckin interfaceMessageObservation
-
onMessageNack
Description copied from interface:MessageObservationNotify the observation of negative acknowledgement event- Specified by:
onMessageNackin interfaceMessageObservationreason- the reason of the negative acknowledgement
-