IMessageConsumer.GetOffsets method
Look up the offsets for the given partitions by timestamp. The returned offset for each partition is the earliest offset whose timestamp is greater than or equal to the given timestamp in the corresponding partition.
public List<TopicPartitionOffset> GetOffsets(
IEnumerable<TopicPartitionTimestamp> timestampsToSearch, TimeSpan timeout)
parameter | description |
---|---|
timestampsToSearch | The mapping from partition to the timestamp to look up. |
timeout | The maximum period of time the call may block. |
Return Value
A mapping from partition to the timestamp and offset of the first message with timestamp greater than or equal to the target timestamp.
Exceptions
exception | condition |
---|---|
KafkaException | Thrown if the operation fails. |
TopicPartitionOffsetException | Thrown if any of the constituent results is in error. The entire result (which may contain constituent results that are not in error) is available via the Results property of the exception. |
Remarks
The consumer does not need to be assigned to the requested partitions.
See Also
- interface IMessageConsumer
- namespace KafkaFlow.Consumers