RdKafka::getMetadata

(PECL rdkafka >= 1.0.0)

RdKafka::getMetadataRequest Metadata from broker

Description

public RdKafka\Metadata RdKafka::getMetadata ( bool $all_topics , RdKafka\Topic|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\Topic|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::getMetadata() example

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

$local $kafka->metadata(falseNULL60e3);

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

Errors/Exceptions