Set properties specific to Kafka configuration
This function requires Streaming Data Framework for MATLAB® Production Server™.
It is recommended that you set Kafka provider properties when creating a Kafka stream object using
If you need to set properties after object creation using
setProviderProperties, set them before the object interacts with
the stream, such as when reading or writing data to a Kafka topic. After the stream object interacts with an event stream, setting
Kafka properties might have no effect.
Set Kafka Security Protocol
Assume that you have a Kafka server running at the network address
that has a topic
Create an event stream object connected to a Kafka topic.
ks = kafkaStream("kafka.host.com",9092,"coolingFan");
Set security properties that are specific to Kafka.
setProviderProperties(ks, ... "security.protocol","SASL_SSL", ... "sasl.mechanism","SCRAM-SHA-512");
Alternatively, you can set these properties when you create the object.
ks = kafkaStream("kafka.host.com",9092,"CoolingFan", ... "security.protocol","SASL_SSL", ... "sasl.mechanism","SCRAM-SHA-512");
ks — Object connected to Kafka stream topic
Object connected to a Kafka stream topic, specified as a
propname — Name of Kafka provider property
string scalar | character vector
Name of a Kafka provider property, specified as a string scalar or character vector.
propval — Value of Kafka provider property
Value of a Kafka provider property, specified as a MATLAB expression. The expression must be a string or convertible to a string.
Stream Provider Properties
Stream providers such as Kafka have vendor-specific configuration properties that influence how the stream provider operates on the stream. Some properties apply to a single type of operation, such as topic creation, while other properties apply to multiple operations. Properties are grouped into categories so that properties are sent only to the provider with operations that support them. Because the same property can belong to multiple categories, each property is uniquely identified by the combination of its name and category.
Introduced in R2022b