title | date | draft |
---|---|---|
assign |
2020-12-27 22:09:37 +0100 |
false |
public function assign(array $topics): void {}
Atomic assignment of partitions to consume.
The new partitions
will replace the existing assignment.
$conf = SimpleKafkaClient\Configuration();
$conf->set('metadata.broker.list', 'kafka:9092');
$consumer = new SimpleKafkaClient\Consumer($conf);
$consumer->assign(
[
new SimpleKafkaClient\TopicPartition('test-topic', 1, 3000),
new SimpleKafkaClient\TopicPartition('test-topic', 2, 3009)
]
);