Skip to content
This repository was archived by the owner on Sep 20, 2024. It is now read-only.

agkloop/products-compare

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 

Repository files navigation

products-comparison

This project is composed of 2 microservices
  • REST API (Reading ) + projection consumer that updates the db in a realtime fashion.
  • Sources scraping and mapping

REST API (Reading ) + projection consumer

built using reactor reactive stream on jvm and high performance batch db writing using jdbc template api

Sources scraping and mapping

is built using reactive kafka that integrate reactive streams with kafka API it's also use protobuf serialization protocol in the published messages and communication between the producer and consumer.

Following the reactive architecture the high level structure

Image of Yaktocat

How it works

  1. in the Sources/dataProvider microservice we have a scheduled task that run every day or week for each source here
  2. the Sources/dataProvider fetch and map the data to a common structure then push it to kafka
  3. in the Projection there is a reactive consumer running to consume and update the DB in a real time with backpressure applied.
  4. finally, the REST API part here

what is missing

  1. Separating the projection consumer to be a separate service using kafka-connect
  2. Using elastic search cluster as a primary source of data
  3. Using kubernetes
  4. More test coverage

Requirement

  • jave 15
  • maven
  • Docker

Build

  1. run mvn clean package to create the jar file
  2. run docker-compose up --build

Try

  1. call ${localhost/docker-machine-ip}:8080/category to list all the available categories
  2. call ${localhost/docker-machine-ip}:8080/category/{Category_id}/product/{Product_name} to list all the available products that have similar name with prices eg: call http://192.168.99.100/:8080/category/1/product/iphone

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors