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.

Streaming analytics: Helper classes

Streaming analytics: Helper classes

- [Tutor] We will now look into implementing helper classes for the streaming analytics use case in this video. The code for this use case is in the com.learning.Kafkastreaming.chaptertwopackage in the Java project for this course. This contains a number of classes. I will walk through the code now, we start with MariaDB manager. This class is used to manage connections to the streaming DB we created earlier in the course. It is used for both inserting new data and querying periodic summaries. The setup method opens a connection to MariaDB, the teardown connection closes the existing connection. The insert summary method is used to insert a summary record into the order summary table. The run method can be used to continuously run a query function every five seconds. It queries for new records in the table. After this thread has started and prints the total records and the total order value. We will use the color blue to…

Contents