Restful Webservice to ingest and analyze IOT data(Car tracker sensor data). Data is fetched from http://mocker.ennate.academy/ We will use Elasticsearch as our database. It provides a fast, scalable datastore. Its JSON based documents provide an extensible design which makes addiing/removing attributes to our dataset easy. The service provides alerts based on certain rules defined. Eg: If the EngineRPM > RedLineRPM, an alert is raised. Alerts are shown and analyzed in real time on Kibana dashboard.(Screenshots attached in the documentations/evidences)
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
- Clone/Fork this repository : git clone https://github.com/vivdalal/Vivek_Dalal_IOT_Lab_project.git
- We are using maven as the build tool and have developed the project in Java 1.8. (You will need to install Java 1.8 and Maven 3.2 or higher - Latest version preferred)
- Java Development Kit - version 1.8.x
- Maven - version 3.2.x or higher
- Elasticsearch - version 6.4.3
- Kibana - version 6.4.3
- IDE : Any IDE of choice
- Postman or any other Rest Client
- Setup Elasticsearch. Follow steps provided on the link below https://www.elastic.co/downloads/elasticsearch
- Setup Kibana. Follow steps provided on the link below https://www.elastic.co/downloads/kibana
- Create vehicle and reading indices in Elasticsearch using the Mapping provided under Vivek_Dalal_IOT_Lab_project/elasticsearch/mappings
- Run the following command in the Vivek_Dalal_IOT_Lab_project/cartrackingapp/
- After successful install, run the command mentioned in the Vivek_Dalal_IOT_Lab_project/cartrackingapp/ run-app-command.txt file
- Start Elasticsearch on port of choice.
- Start kibana. Update the Elasticsearch port in the kibana.yml config file
- Configure the ports for Elasticsearch in the application.properties file of the springboot all
- Once Elasticsearch and Kibana are Up and Running, we can start the springboot app.
- When you start the app for the first time, hit the following endpoint to create the index mapping for vehicle and reading in Elasticsearch
- If a HTTP 200 OK response is received, you can now start pushing data using the mocker service
- Go to http://mocker.ennate.academy/
- Put the following endpoint in the Car Tracker Sensor sections
- http://localhost:8080/cartrackerdata/vehicles
- http://localhost:8080/cartrackerdata/reading
- Hit start on both the endpoints to begin pushing data to the service
- Open Postman
- Import the IOT-Project.postman_collection.json file into Postman. File can be found in the /documentation/evidences directory
- Try out the different HTTP POST/PUT/GET/DELETE requests
- Spin up Kibana.
- Go to the URL : http://localhost:5601
- Go to the Dashboard section from the left
- Select the attribute from the reading index on which you want live updates. For eg : alertlevel is not NONE
- The query will execute at the interval you mention and the output will be shown below on the dashboard
Vivek Dalal