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.

Leaderboards: Helper classes

Leaderboards: Helper classes

- [Instructor] We will start implementing the leaderboard use case in this video, we first look at the helper classes required. The implementation is available in the package, com.learning.kafkastreaming.chapterfour. As we would be using Redis to store the leaderboard, we have a Redis manager class that would print the leaderboard at five second intervals. The class also has additional testing functions. The key name for the leaderboard is set as player leaderboard. The setup method needs to be called to set up a new Redis connection using the Jedis client library. The run method runs continuously queries the leaderboard data with the key retrieves the sorted set and prints the player names and values. It sleeps for five seconds to repeat the printing again. Then we look at the gaming data generator class. It generates dummy gaming data to the streaming.leaderboards.inputtopic. Similar to the generators we saw in the…

Contents