RdKafka\KafkaConsumer::getMetadata

(PECL rdkafka >= 1.0.0, librdkafka >= 0.9)

RdKafka\KafkaConsumer::getMetadataRequest Metadata from broker

Description

public RdKafka\Metadata RdKafka\KafkaConsumer::getMetadata ( bool $all_topics , RdKafka\KafkaConsumerTopic|null $only_topic , int $timeout_ms )

Request Metadata from broker

Parameters

all_topics (bool)

When TRUE, request info about all topics in cluster. Else, only request info about locally known topics.

only_topic (RdKafka\KafkaConsumerTopic|null)

When non-null, only request info about this topic

timeout_ms (int)

Timeout (milliseconds)

Return Values

Returns a RdKafka\Metadata instance

Examples

Example #1 RdKafka\KafkaConsumer::getMetadata() example

<?php
$all 
$kafkaConsumer->metadata(trueNULL60e3);

$local $kafkaConsumer->metadata(falseNULL60e3);

$topic $kafkaConsumer->newTopic("myTopic");
$one $kafkaConsumer->metadata(true$topic60e3);
?>

Errors/Exceptions