From the course: Stream Processing Design Patterns with Kafka Streams
Unlock this course with a free trial
Join today to access over 22,500 courses taught by industry experts.
Code walk-through - Kafka Tutorial
From the course: Stream Processing Design Patterns with Kafka Streams
Code walk-through
- [Instructor] Having designed a solution for website views in the earlier video, I will now review an example implementation for the exercise use case for the course. Please note that your implementation may differ from what is discussed here, but as long as the results match, it is a good solution. We need multiple helper classes for this exercise. They are similar to the use cases we have seen earlier in the course. We need the Kafka views data generator to generate events into the input topic at random intervals. The RedisManager is needed to both update the leaderboard, as well as print the leaderboard every five seconds. This is similar to the leaderboards use case. We need the ViewAggregator class to implement the aggregator function, to sum that total minutes by user. Then we need the WebsiteView as a project class to store the view information received from Kafka. Let's now review the main website views…
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.