From the course: Stream Processing Design Patterns with Kafka Streams
Unlock this course with a free trial
Join today to access over 22,600 courses taught by industry experts.
Real-time predictions: Pipeline implementation - Kafka Tutorial
From the course: Stream Processing Design Patterns with Kafka Streams
Real-time predictions: Pipeline implementation
- [Instructor] Having built the helper classes in the previous video, let's now get to doing streaming predictions. Here, we first start the Kafka Review Data Generator in a separate thread, to generate Kafka messages for reviews. Next, we set up the Serde and the properties for consuming data from Kafka. We build a Stream to consume the streaming.sentiment.input topic. We then use the peek function to print the review that is received. Next, we use the mapValues function to call the sentiment predictor service for each review that is received. The sentiment is then returned to the resulting case stream with the review ID as the key. Now we can push the sentiments to the outgoing Kafka topic, streaming.sentiment.output Since both key and value are in Stream format, we can publish them directly with default serialization. We can now build the stream based on the typology and start the stream. We use the…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.