Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
daavelar opened this issue Jul 26, 2022 · 1 comment · Fixed by #531
Open

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

daavelar opened this issue Jul 26, 2022 · 1 comment · Fixed by #531
Labels

Comments

@daavelar
Copy link

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 daavelar added the bug label Jul 26, 2022
@nick-zh
Copy link
Collaborator

nick-zh commented Jul 26, 2022

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 nick-zh added doc and removed bug labels Jul 26, 2022
@nick-zh nick-zh linked a pull request Jul 26, 2022 that will close this issue
@arnaud-lb arnaud-lb reopened this Jul 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants