Main Content

deleteTopic

Remove topic from Kafka cluster

    This function requires Streaming Data Framework for MATLAB® Production Server™.

    Description

    example

    deleteTopic(ks) removes a topic from a Kafka® cluster, if Kafka permissions allow deletion. The KafkaStream object ks specifies the topic to delete and the network address of the Kafka host that contains the topic. This deletion is permanent. The deleted topic and the data it contains cannot be recovered.

    Examples

    collapse all

    Assume that you have a Kafka server running at the network address kafka.host.com:9092 that has a topic CoolingFan.

    Create an object connected to the CoolingFan topic.

    ks = kafkaStream("kafka.host.com",9092,"CoolingFan");

    If you no longer require the topic and the data in it, you can delete it. You must have the necessary permissions to delete topics.

    deleteTopic(ks)

    Input Arguments

    collapse all

    Object connected to a Kafka stream topic, specified as a KafkaStream object.

    Version History

    Introduced in R2022b