Skip to content
This repository has been archived by the owner on Nov 1, 2024. It is now read-only.

Latest commit

 

History

History
69 lines (54 loc) · 4.24 KB

readme.md

File metadata and controls

69 lines (54 loc) · 4.24 KB

Drone Tracker App

DroneTrackerApp is a simulated IOT application. The DroneTracker web service exposes a REST api that drones can send data to, including temperature and position. A separate DroneSim application (although within the same codebase) simulates independent drones flying around with randomized position and temperature. The DroneTracker process this data stream using akka-streams in a distributed manner using akka-cluster-sharding. Akka-management is used for cluster bootstrap and service discovery. All this is deployed to Kubernetes with Lightbend Telemetry and Lightbend Console providing application visibility. This application is built using Java/Maven

Deployment Architecture

deployment architecture

Note that in place of actual drones, a DroneSim application, which is an akka-cluster application simulates the behavior of drones using actors. Each drone nonetheless communicates to the DroneTracker application via HTTP

Application Architecture

deployment architecture

The data processing pipeline consists of 3 akka-streams pipelines, parallelized and distributerd using akka-cluster-sharding worker entities. Each pipeline is logically grouped into a shard region. Finally, the REST controller provides the ability to query the aggregated state directly from the shard regions.

Caveats

  • the combination of akka-cluster-sharding with akka-streams for distributed stream processing is an interesting architectural pattern, but may or may not be an ideal application architecture depending on your use case. Alternative architectures such as using kafka or intermediate message brokering and spark-streaming for stateful message processing can have some benefits wrt decoupling logical pipelines, replaying data, more efficient network bandwidth usage, etc., although at the cost of higher operational and network complexity. Both Kafka and Spark are a part of the Lightbend Fast Data Platform
  • The purpose of this demo application is simply to demonstrate how you can flexibly combine different capabilities of the Lightbend Technology Platform for a given use case.

Installation Instructions

Prerequisites

Installing Custom Metrics Dashboard

DroneTracker comes with a custom Grafana dashboard to display business metrics via Lightbend Telemetry. To install the the dashboard,

  1. copy the contents of grafana.json to your clipboard
  2. open your browser to the Lightbend Console
  3. click on the Grafana link in the upper left corner
  4. click on the 'Import Dashboard' link in Grafana from the left navigation bar. Paste the contents of your clipboard and click 'Load'

Shopping Cart App Dashboard

Building and Deploying the Application

  1. initialize your docker environment. You can do this from the terminal with eval $(minikube docker-env)
  2. from the terminal, build the application with mvn package docker:build
  3. deploy the DroneTracker into minikube with kubectl apply -f drone-tracker.yaml
  4. deploy the DroneSim into minikube with kubectl apply -f drone-sim.yaml
  5. open up the Lightbend Console with minikube service expose-es-console --namespace lightbend

shoppingcartapp deployed