(PECL rdkafka >= 0.9.1)
RdKafka::newTopic — Create a new topic instance
$topic_name
[, RdKafka\TopicConf $topic_conf
= NULL
] )
Creates a new topic instance for topic_name
.
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.
Returns a RdKafka\Topic (more specifically, either a RdKafka\ConsumerTopic or a RdKafka\ProducerTopic).
Example #1 RdKafka::newTopic() example
<?php
$conf = new RdKafka\TopicConf();
$conf->set("...", "...");
$topic = $kafka->newTopic("myTopic", $conf);
?>