(PECL rdkafka >= 4.0.0, librdkafka >= 0.9.4)

RdKafka::offsetsForTimesGet offsets for timestamps


public RdKafka::offsetsForTimes ( array $topicPartitions , integer $timeout_ms ) : array

Gets the earliest offset for a given timestamp for an array of RdKafka\TopicPartition


topicPartitions (array)

Is an array of RdKafka\TopicPartition, assign your timestamp to the offset during instantiation of RdKafka\TopicPartition

timeout_ms (integer)

The timout in milliseconds for the offset fetch

Return Values

Returns an array of RdKafka\TopicPartition where the offset is now the earliest offset found for the given timestamp