Skip to content

Files

Latest commit

 

History

History
23 lines (23 loc) · 583 Bytes

File metadata and controls

23 lines (23 loc) · 583 Bytes
title date draft
assign
2020-12-27 22:09:37 +0100
false

Description

public function assign(array $topics): void {}

Atomic assignment of partitions to consume.
The new partitions will replace the existing assignment.

Example

$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)
    ]
);