Skip to main content
Version: 3.x

IMessageConsumer.GetWatermarkOffsets method

Get the last cached low (oldest available / beginning) and high (newest/end) offsets for a topic/partition. Does not block.

public WatermarkOffsets GetWatermarkOffsets(TopicPartition topicPartition)
parameterdescription
topicPartitionThe topic partition of interest.

Return Value

The requested WatermarkOffsets (see that class for additional documentation).

Remarks

The low offset is updated periodically (if statistics.interval.ms is set) while the high offset is updated on each fetched message set from the broker. If there is no cached offset (either low or high, or both) then Offset.Unset will be returned for the respective offset.

See Also