/PhoneCenter

Phone Center Architecture using Play, Akka, Scala, Kafka, Kamon & Datadog

Primary LanguageScala

PhoneCenter   

Phone Center Architecture using Play, Akka, Scala, Kafka, Kamon & Datadog

Created during the third year at Ariel University in the Department of Computer Science, 2020
Project site: https://github.com/ZviMints/PhoneCenter
Made by: Zvi Mints, and Eilon Tsadok

Run The Project:

  1. Open the terminal in this path: PhoneCenter/CallProducer/ and run sbt clean runProd -Dhttp.port=8080

  2. Open the terminal in this path: PhoneCenter/CallConsumer/ and run sbt clean runProd

  3. Start the MongoDB server.

  4. run the Kafka server by the following commends:

    bin/zookeeper-server-start.sh config/zookeeper.properties

    bin/kafka-server-start.sh config/server.properties

  5. Start Redis with Kitematic on localhost:6379

  6. Open https://apm.kamon.io/demo/demo/dashboards/ to get analytics.

  7. Open the browser and go to the url https://localhost:8080/ and start to answer calls.

About The Project:

We have developed an asynchronous system that aims to simulate the architecture of a phone call center:

Flow: (CallProducer Service)

  1. When user press set button with new number of waiting calls, The number is sent to route named /totalWaitingCalls which aims to send a new message to Kafka with that number on topic monitorTopic which is env variable.
  2. The user enters a call by clicking the סיום button.
  3. The call is sent to route named /send which aims to enter the call with the Ready status into MongoDB.
  4. There is Akka's Actor who from time to time gets all the calls with the Ready status and locks them (in order to avoid Race Conditions).
  5. The Actor sends the message to Kafka on topic callsTopic which is env variable.

Flow: (CallConsumer Service)

  1. As soon as the app goes up there is an Actor who wakes up and listens to Kafka.
  2. Once there is a new message, the call is being saved into the cache (when the cache is implemented by Redis) for 12 hours.
  3. There is an update of new metrics by Kamon.
  4. There is a send from Kamon to APM Kamon Dashboard which graphically displays the information.

Below are pictures of the Dashboard:

You can select start time and end time for each metric