kafkaStream
This object requires Streaming Data Framework for MATLAB® Production Server™.
Description
The kafkaStream
function creates a
KafkaStream
object that connects to a Kafka® topic and reads and writes event streams from that topic.
An event consists of three parts:
Key — Identifies event source
Timestamp — Indicates time at which event occurred
Body — Contains event data specified as an unordered set of (name, value) pairs
After creating a KafkaStream
object, use the readtimetable
function to read the events into a timetable or the writetimetable
function to write a timetable to the stream.
readtimetable
converts events into rows of a timetable. The names in
the event body become the timetable column names, the value associated with each name becomes
the column value in the event row, and the event timestamp becomes the row timestamp.
writetimetable
converts rows of a timetable into events in a
stream.
Creation
Syntax
Description
Row-Based Event Window
Duration-Based Event Window
ks = kafkaStream(
creates a host
,port
,topic
,Duration=timespan
)KafkaStream
object that reads stream events occurring during
the specified timestamp span timespan
.
Additional Options
ks = kafkaStream(___,
specifies event stream options using one or more name-value
arguments. You can also set properties
using name-value arguments. You can use these name-value arguments and properties to
specify how events are converted to and from timetables.Name=Value
)
Input Arguments
Name-Value Arguments
Properties
Object Functions
Examples
Version History
Introduced in R2022b