RdKafka\KafkaConsumer::getCommittedOffsets

(PECL rdkafka >= 3.1.0, librdkafka >= 0.9)

RdKafka\KafkaConsumer::getCommittedOffsetsReturns the committed offsets

Description

public RdKafka\KafkaConsumer::getCommittedOffsets ( array $topics , int $timeout_ms ) : array

Returns the committed offsets for topics and partitions for a consumer group

Parameters

topics (array)

Array of RdKafka\TopicPartition.

timeout_ms (int)

Timeout in milliseconds.

Return Values

Returns an array of RdKafka\TopicPartition with their offsets

Examples

Example #1 RdKafka\KafkaConsumer::getCommittedOffsets() example

<?php
$conf 
= new RdKafka\Conf();
$conf->set("group.id""myGroupID");

$kafkaConsumer = new RdKafka\KafkaConsumer($conf);
$topicPartition = new TopicPartition('myTopic'0);
$timeoutMs 10000000;

$topicPartitionsWithOffsets $kafkaConsumer->getCommittedOffsets([$topicPartition], $timeoutMs));
?>

Errors/Exceptions