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
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
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.
- Maven is installed
- jdk 1.8 is installed
- Docker is installed
- minikube running and Lightbend Console installed
- you have valid Bintray credentials set up on your dev box
DroneTracker comes with a custom Grafana dashboard to display business metrics via Lightbend Telemetry. To install the the dashboard,
- copy the contents of grafana.json to your clipboard
- open your browser to the Lightbend Console
- click on the Grafana link in the upper left corner
- click on the 'Import Dashboard' link in Grafana from the left navigation bar. Paste the contents of your clipboard and click 'Load'
- initialize your docker environment. You can do this from the terminal with
eval $(minikube docker-env)
- from the terminal, build the application with
mvn package docker:build
- deploy the DroneTracker into minikube with
kubectl apply -f drone-tracker.yaml
- deploy the DroneSim into minikube with
kubectl apply -f drone-sim.yaml
- open up the Lightbend Console with
minikube service expose-es-console --namespace lightbend