Class OffsetSpecification

java.lang.Object
com.rabbitmq.stream.OffsetSpecification

public class OffsetSpecification extends Object
API to specify an offset in a stream.
  • Method Details

    • none

      public static OffsetSpecification none()
      When the offset specification is not relevant.
      Returns:
      none offset specification
    • first

      public static OffsetSpecification first()
      The first available offset in the stream.

      If the stream has not been truncated, this means the beginning of the stream (offset 0).

      Returns:
      first offset in a stream
    • last

      public static OffsetSpecification last()
      The last chunk of messages in the stream.
      Returns:
      the offset of the last chunk of messages
    • next

      public static OffsetSpecification next()
      The next offset to be written, that is the end of the stream.
      Returns:
      The next offset to be written
    • offset

      public static OffsetSpecification offset(long offset)
      A specific offset in the stream.

      The first offset of a non-truncated stream is 0.

      Parameters:
      offset -
      Returns:
      the absolute offset
    • timestamp

      public static OffsetSpecification timestamp(long timestamp)
      Offset of messages stored after the specified timestamp.

      Be aware consumers can receive messages published a bit before the specified timestamp.

      Parameters:
      timestamp -
      Returns:
      messages stored after the specified timestamp
    • isOffset

      public boolean isOffset()
    • isTimestamp

      public boolean isTimestamp()
    • getType

      public short getType()
    • getOffset

      public long getOffset()
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object