Main Content


Remove topic from Kafka cluster

Since R2022b

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



    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.


    collapse all

    Assume that you have a Kafka server running at the network address that has a topic CoolingFan.

    Create an object connected to the CoolingFan topic.

    ks = kafkaStream("",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.


    Input Arguments

    collapse all

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

    Version History

    Introduced in R2022b