stop
This function requires Streaming Data Framework for MATLAB® Production Server™.
Syntax
Description
Examples
Stop Streaming Data from Kafka Topic
Assume that you have a Kafka server running at the network address
kafka.host.com:9092
. This server has a topic
RecamanSequence
that contains numbers in Recamán's
sequence.
Create a KafkaStream
object for reading event stream data from the
RecamanSequence
topic.
ks = kafkaStream("kafka.host.com",9092,"RecamanSequence");
Read the first 50 rows from the stream.
tt = readtimetable(ks)
tt = 50×2 timetable timestamp R key ____________________ __ ____ 27-Jun-2022 18:37:52 0 "0" 27-Jun-2022 18:37:53 1 "1" 27-Jun-2022 18:37:54 3 "2" 27-Jun-2022 18:37:55 6 "3" 27-Jun-2022 18:37:56 2 "4" 27-Jun-2022 18:37:57 7 "5" 27-Jun-2022 18:37:58 13 "6" 27-Jun-2022 18:37:59 20 "7" : : : 27-Jun-2022 18:38:34 37 "42" 27-Jun-2022 18:38:35 80 "43" 27-Jun-2022 18:38:36 36 "44" 27-Jun-2022 18:38:37 81 "45" 27-Jun-2022 18:38:38 35 "46" 27-Jun-2022 18:38:39 82 "47" 27-Jun-2022 18:38:40 34 "48" 27-Jun-2022 18:38:41 83 "49"
Preview the next 8 rows in the stream. The read position is set immediately after the last row read from the stream.
preview(ks)
ans = 8×2 timetable timestamp R key ____________________ __ ____ 27-Jun-2022 18:38:42 33 "50" 27-Jun-2022 18:38:43 84 "51" 27-Jun-2022 18:38:44 32 "52" 27-Jun-2022 18:38:45 85 "53" 27-Jun-2022 18:38:46 31 "54" 27-Jun-2022 18:38:47 86 "55" 27-Jun-2022 18:38:48 30 "56" 27-Jun-2022 18:38:49 87 "57"
Stop processing the stream.
stop(ks)
Input Arguments
ks
— Object connected to Kafka stream topic
KafkaStream
object
Object connected to a Kafka stream topic, specified as a KafkaStream
object.
Version History
Introduced in R2022b
Comando de MATLAB
Ha hecho clic en un enlace que corresponde a este comando de MATLAB:
Ejecute el comando introduciéndolo en la ventana de comandos de MATLAB. Los navegadores web no admiten comandos de MATLAB.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)