Interface StreamStats


public interface StreamStats
Statistics on a stream.
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    long
    The ID (offset) of the committed chunk (block of messages) in the stream.
    long
    The offset of the last committed message in the stream.
    long
    The first offset in the stream.
  • Method Details

    • firstOffset

      long firstOffset()
      The first offset in the stream.
      Returns:
      first offset in the stream
      Throws:
      NoOffsetException - if there is no first offset yet
    • committedChunkId

      long committedChunkId()
      The ID (offset) of the committed chunk (block of messages) in the stream.

      It is the offset of the first message in the last chunk confirmed by a quorum of the stream cluster members (leader and replicas).

      The committed chunk ID is a good indication of what the last offset of a stream can be at a given time. The value can be stale as soon as the application reads it though, as the committed chunk ID for a stream that is published to changes all the time.

      Use committedChunkId() instead if the last offset in the stream is needed.

      Returns:
      committed offset in this stream
      Throws:
      NoOffsetException - if there is no committed chunk yet
      See Also:
    • committedOffset

      long committedOffset()
      The offset of the last committed message in the stream.

      The value can be stale as soon as the application reads it though, as the last committed offset for a stream that is published to changes all the time.

      Requires RabbitMQ 4.3 or more.

      Returns:
      last committed offset
      Throws:
      NoOffsetException - if there is no committed message yet or if the value is not available