Interface PubSubPosition

All Superinterfaces:
Measurable
All Known Implementing Classes:
ApacheKafkaOffsetPosition, InMemoryPubSubPosition

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

  • Method Details

    • getNumericOffset

      long getNumericOffset()
    • equals

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

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

      default boolean isSymbolic()
    • 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
    • toWireFormatBuffer

      default ByteBuffer toWireFormatBuffer()
      Returns the serialized wire format bytes of this position.
      Returns:
      byte array representing the position in wire format
    • toWireFormatBytes

      default byte[] toWireFormatBytes()
      Serializes this position to a wire format and returns the result as a byte array. This method bypasses ByteBuffer and directly returns the backing array.
      Returns:
      a byte array representing the serialized wire format of this position
    • getFactoryClass

      Class<? extends PubSubPositionFactory> getFactoryClass()
      Returns the factory class responsible for creating this position type. This enables strong type checking and reflection-based instantiation without requiring the actual factory instance to be returned.
      Returns:
      the class object of the factory that can construct this position
    • getFactoryClassName

      default String getFactoryClassName()