Skip to content
Apache Bahir - MQTT Analytics demo using Apache Spark and Apache Bahir
JavaScript Scala HTML CSS Shell
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

Apache Bahir IoT Demo

This demo provides a Web Application that simulates devices collecting metrics from a elevetor and submits these metrics to a MQTT server using a diffeferent topic for each metric.

It also provides a Spark Application that subscribe to the MQTT topic using the Apache Bahir MQTT streaming connector.

Setting up the infrastructure

Boostraping the MQTT server

We boostrap a MQTT Mosquitto server using publicly available docker image

docker run -ti --name mosquitto -p 1883:1883 -p toke/mosquitto:latest

If you get an error because you already have an existent exited container with the same name, issue the command below

docker rm -f mosquitto

Bostrap the web simulator

cd web-simulator/simulator
node app.js

Note: When starting for the first time, you need to use npm to install required dependencies

cd web-simulator/simulator
npm install
node app.js

Then access the simulator in your browser


Starting your Spark Application

Now we are ready to submit our Spark Application that will subscribe to some MQTT topics and start processing data

cd spark-iot-analytics

The command above will build the application and submit it with it's required dependencies

You can’t perform that action at this time.