Interface PubSubPosition

All Known Implementing Classes:
ApacheKafkaOffsetPosition

public interface PubSubPosition
Represents a position of a message in a partition of a topic.
  • Field Details

    • EARLIEST

      static final PubSubPosition EARLIEST
      A special position representing the earliest available message in a partition. All pub-sub adapters must support this position, and all pub-sub client implementations should interpret it as the earliest retrievable message in the partition. Implementations must map this position to the corresponding earliest offset or equivalent marker in the underlying pub-sub system.
    • LATEST

      static final PubSubPosition LATEST
      A special position representing the latest available message in a partition. All pub-sub adapters must support this position, and all pub-sub client implementations should interpret it as the most recent retrievable message in the partition. Implementations must map this position to the corresponding latest offset or equivalent marker in the underlying pub-sub system.
  • Method Details

    • comparePosition

      int comparePosition(PubSubPosition other)
      Parameters:
      other - the other position to compare to
      Returns:
      returns 0 if the positions are equal, -1 if this position is less than the other position, and 1 if this position is greater than the other position
    • diff

      long diff(PubSubPosition other)
      Returns:
      the difference between this position and the other position
    • equals

      boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      int hashCode()
      Overrides:
      hashCode in class Object
    • getPositionWireFormat

      PubSubPositionWireFormat getPositionWireFormat()
      Position wrapper is used to wrap the position type and the position value. This is used to serialize and deserialize the position object when sending and receiving it over the wire.
      Returns:
      the position wrapper
    • getPositionFromWireFormat

      static PubSubPosition getPositionFromWireFormat(byte[] positionWireFormatBytes)
    • getPositionFromWireFormat

      static PubSubPosition getPositionFromWireFormat(PubSubPositionWireFormat positionWireFormat)