php-rdkafka icon indicating copy to clipboard operation
php-rdkafka copied to clipboard

Exception : RdKafka\Metadata::__construct() has not been called

Open daavelar opened this issue 3 years ago • 1 comments

Description

The following code:

<?php

$metadata = new Metadata;
$metadata->getTopics()

Resulted in this output:

Exception : RdKafka\Metadata::__construct() has not been called

But I expected to get the topics list.

php-rdkafka Version

php-rdkafka 6.0.3

librdkafka Version

1.8.2~1confluent7.2.1-1

PHP Version

php 8.1.8

Operating System

Ubuntu 22.04

Kafka Version

2.6.3

daavelar avatar Jul 26 '22 12:07 daavelar

This might be misleading, you need to call an RdKafka or KafkaConsumer instance to get metadata, see doc Maybe docs or examples can be improved to make this more clear

nick-zh avatar Jul 26 '22 12:07 nick-zh