RdKafka\KafkaConsumer::newTopic

(No version information available, might only be in Git)

RdKafka\KafkaConsumer::newTopicCreate a new topic instance

Description

public RdKafka\Topic RdKafka\KafkaConsumer::newTopic ( string $topic_name [, RdKafka\TopicConf $topic_conf = NULL ] )

Creates a new topic instance for topic_name.

Parameters

topic_name

Topic name

topic_conf

Optional configuration that will be used instead of the default topic configuration.

Note:

Creating two topic instances for the same topic name with different configurations has no effect. Every topic instance will use the configuration of the first instance.

Return Values

Returns a RdKafka\ConsumerTopic.

Examples

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

<?php
$conf 
= new RdKafka\TopicConf();
$conf->set("...""...");

$topic $kafka->newTopic("myTopic"$conf);
?>