Solution Pattern: Recommendation Engine using Event Streaming

Architecture

Introduction for the architecture of this solution pattern.

2. An in-depth look at the solution’s architecture

To support the business requirement of capturing and processing user activity on the Globex Coolstuff application, two new services have been developed:

  • Activity Tracking service: This service exposes a REST endpoint. User activities on the Globex website (such as opening a product page, liking a product etc.) generates an activity payload which is sent to the Activity Tracking REST endpoint. The service transforms this payload into a Kafka message which is sent to a topic on the Kafka broker.

  • Recommendation Engine: This service consumes and processes the events produced by the Activity Tracking service. The service uses the Kafka Streams library to continuously determine the top featured products (the products which generate the most activities). The service also exposes a REST endpoint to expose the list of featured products.

Both services are developed using Quarkus, the Quarkus extensions for reactive messaging and Kafka Streams. The development of the services is outside the scope of this workshop, but you are encouraged to examine the source code of the applications on GitHub: Activity Tracking Service and Recommendation Engine

globex runtime architecture 2

Here is a view of the deployment architecture

globex deployment architecture 2

All services and the website are deployed on Red Hat OpenShift running on the cloud.