Create topic in Kafka cluster
This function requires Streaming Data Framework for MATLAB® Production Server™.
createTopic( creates a topic on the
Kafka® host, if Kafka cluster permissions allow creation. The
ks specifies the topic to create and the network address of the
Kafka host that contains the topic.
Create Topic in Kafka Cluster
Assume that you have a Kafka server running at network address
Create an object connected to the Kafka host that interacts with a topic called
ks = kafkaStream("kafka.host.com",9092,"CoolingFan");
CoolingFan topic does not exist during object creation,
you can create it. You must have the necessary permissions to create topics.
ks — Object connected to Kafka stream topic
Object connected to a Kafka stream topic, specified as a
action — Action to take if topic does not exist
create (default) |
Action to take if the topic does not exist, specified as one of the following values:
create— Creates new topic, if you have the required permissions on the Kafka host.
fail— Does not create a new topic.
Introduced in R2022b