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: Use case design

Real-time predictions: Use case design

- How do we implement the real time predictions pattern? Let's review the use case we will be building in this chapter. We have a Kafka input topic, that contains reviews, posted by users on a movie website. As users post reviews, they are streamed through this topic. Each message contains a review ID and the review content as text. The goal of this use case, is to use HTTP service to predict sentiment of the reviews, and post the sentiments, to an outgoing topic. The HTTP service takes as input, the text content, and returns a sentiment that has five values, very negative, negative, neutral, positive and very positive. Each review message needs to be sent to the service, and then the return sentiment needs to be posted to an outgoing topic in Kafka. What is the design for this use case? We first consume an input topic called, Streaming.sentiment.input. First, key and value attributes in the Kafka message needs to be…

Contents