Class MessageEvent

java.lang.Object
io.opencensus.trace.BaseMessageEvent
io.opencensus.trace.MessageEvent
Direct Known Subclasses:
AutoValue_MessageEvent

@Immutable public abstract class MessageEvent extends BaseMessageEvent
A class that represents a generic messaging event. This class can represent messaging happened in any layer, especially higher application layer. Thus, it can be used when recording events in pipeline works, in-process bidirectional streams and batch processing.

It requires a type and a message id that serves to uniquely identify each message. It can optionally have information about the message size.

Since:
0.12
  • Constructor Details

    • MessageEvent

      MessageEvent()
  • Method Details

    • builder

      public static MessageEvent.Builder builder(MessageEvent.Type type, long messageId)
      Returns a new MessageEvent.Builder with default values.
      Parameters:
      type - designates whether this is a send or receive message.
      messageId - serves to uniquely identify each message.
      Returns:
      a new Builder with default values.
      Throws:
      NullPointerException - if type is null.
      Since:
      0.12
    • getType

      public abstract MessageEvent.Type getType()
      Returns the type of the MessageEvent.
      Returns:
      the type of the MessageEvent.
      Since:
      0.12
    • getMessageId

      public abstract long getMessageId()
      Returns the message id argument that serves to uniquely identify each message.
      Returns:
      the message id of the MessageEvent.
      Since:
      0.12
    • getUncompressedMessageSize

      public abstract long getUncompressedMessageSize()
      Returns the uncompressed size in bytes of the MessageEvent.
      Returns:
      the uncompressed size in bytes of the MessageEvent.
      Since:
      0.12
    • getCompressedMessageSize

      public abstract long getCompressedMessageSize()
      Returns the compressed size in bytes of the MessageEvent.
      Returns:
      the compressed size in bytes of the MessageEvent.
      Since:
      0.12