(PECL rdkafka >= 1.0.0, librdkafka >= 0.9)
RdKafka\KafkaConsumer::commit — Commit offsets
Commit offsets synchronously, block until offsets are committed or the commit fails.
Note:
If a commit_cb callback is registered it will be called with commit details on a future call to consume.
message_or_offsets
NULL
, commit offsets for the current assignment.
Example #1 RdKafka\KafkaConsumer::commit() example
<?php
// Commit offsets for the current assignment
$kafkaConsumer->commit();
// Commit offsets based on the message's topic, partition, and offset
$kafkaConsumer->commit($message);
// Commit offsets by providing a list of TopicPartition
$kafkaConsumer->commit([
new RdKafka\TopicPartition($topic, $partition, $offset),
]);
?>