Interface MessageObservation

All Known Implementing Classes:
DefaultMessageObservation

public interface MessageObservation
The message observation contract
  • 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:
      true if the message processing is completed with acknowledgement or negative acknowledgement
    • getReason

      Throwable getReason()
      Returns:
      the negative acknowledgement reason
    • onMessageAck

      void onMessageAck(Message<?> message)
      Notify the observation of acknowledgement event
    • onMessageNack

      void onMessageNack(Message<?> message, Throwable reason)
      Notify the observation of negative acknowledgement event
      Parameters:
      reason - the reason of the negative acknowledgement