Main Content

categoryList

Kafka stream provider property list

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

    Description

    example

    list = categoryList(ks,cat) returns the names and categories of all the Kafka® stream provider properties and their respective values from the categories cat for the object ks.

    The returned list is a cell array of alternating structures and values of the form {name_sctruct1,value1,...,name_structN,valueN}, where:

    • name_struct is a structure with fields "category" and "name". These fields define the category name and property name, respectively.

    • value contains the value of the property named in the preceding structure. value can be of any type.

    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 a KafkaStream object connected to the Kafka host and also specify security properties during object creation.

    ks = kafkaStream("kafka.host.com",9092,"CoolingFan", ...
                        "security.protocol","SSL", ...
                        "ssl.truststore.type","PEM", ...
                        "ssl.truststore.location","kafka-boston.pem");
    

    Get the names, categories, and values of the two Kafka provider properties in the "Uncategorized" category.

    • Property ssl.truststore.location has a value of "kafka-boston.pem"

    • Property ssl.truststore.type has a value of "PEM"

    list = categoryList(ks,"Uncategorized")
    prop1 = list{1}
    prop2 = list{3}
    list =
    
      1×4 cell array
    
        {1×1 struct}    {["kafka-boston.pem"]}    {1×1 struct}    {["PEM"]}
    
    
    prop1 = 
    
      struct with fields:
    
            name: 'ssl.truststore.location'
        category: 'Uncategorized'
    
    
    prop2 = 
    
      struct with fields:
    
            name: 'ssl.truststore.type'
        category: 'Uncategorized'

    Input Arguments

    collapse all

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

    Kafka stream provider category name, specified as a string scalar, character vector, string array, or cell array of character vectors. This table shows the categories that Streaming Data Framework for MATLAB Production Server supports. Properties can belong to more than one category.

    CategoryDescription
    Uncategorized

    Contains all Kafka provider properties that do not fall into any other category

    Kafka Property Example: ssl.truststore.pem

    Consumer

    Contains provider properties specific to a Kafka consumer

    Kafka Property Example: security.protocol

    ConsumerTopic

    Contains provider properties specific to reading a topic

    Producer

    Contains provider properties specific to a Kafka producer

    Kafka Property Example: security.protocol

    ProducerTopic

    Contains provider properties specific to writing to a Kafka topic

    Kafka Property Example: max.request.size

    CreateTopic

    Contains provider properties specific to creating a Kafka topic

    Kafka Property Example: retention.ms

    KafkaConnector

    Contains provider properties for interacting with the Kafka Connector interface. readtimetable uses this interface when you set the Order property to EventTime in a KafkaStream object.

    Kafka Property Example: sasl.jaas.config

    librdkafka

    Contains provider properties for interacting with the Kafka interface librdkafka. readtimetable uses this interface when you set the Order property to IngestTime in a KafkaStream object. writetimetable always uses librdkafka.

    Kafka Property Example: sasl.username

    Example: categoryList(ks,["WriteTopic" "CreateTopic"]) returns any provider properties set in ks that are related to creating or writing a topic.

    Data Types: char | string | cell

    Version History

    Introduced in R2022b