(PECL rdkafka >= 1.0.0, librdkafka >= 0.9)
RdKafka\KafkaConsumer::assign — Update the assignment set
$topic_partitions
= NULL
] ) : void
Update the assignment set to topic_partitions
.
The assignment set is the set of partitions actually being consumed by the KafkaConsumer.
Note:
For automatic partition assignment, use RdKafka\KafkaConsumer::subscribe()
Note:
The default configuration for assigned topics can be changed in RdKafka\Conf::set().
topic_partitions
(array)Array of RdKafka\TopicPartition to assign
Example #1 RdKafka\KafkaConsumer::assign() example
<?php
$kafkaConsumer->assign([
new RdKafka\TopicPartition("logs", 0),
new RdKafka\TopicPartition("logs", 1),
]);
?>