Git Product home page Git Product logo

genesys_rt's Introduction

Building and running this project locally

Building Java Archive

Following command builds all Java components to genesys_rt/target/myproject-1.0-SNAPSHOT.jar JAR file

mvn clean install

Running from Jar Archive

Following command starts the application using JAR file:

  java -jar genesys_rt/target/myproject-1.0-SNAPSHOT.jar

Running from IntelliJ IDE

Here are the steps to run or debug the application from Intellij:

  1. Enable the desired maven profile form Maven Tool Window
  2. Run a configuration from Run -> Edit configurations

Accessing services APIs

  1. Register a sensor, where {sensorId} should be a BigDecimal
curl --location --request POST 'localhost:8080/v1/sensors/sensor/{sensorId}/register' \
--header 'Content-Type: application/json' \
--data-raw '{
    "city": "mycity",
    "country": "mycountry"
}'
  1. Save Sensor data (Assistive service if kafka server not running)
curl --location --request POST 'localhost:8080/v1/sensors/data' \
--header 'Content-Type: application/json' \
--data-raw '{ 
  "sensorId":200,
  "temperature":1.2,
  "humidity":1.2,
  "timestamp":"2020-01-02 00:00:00.000"
}'
  1. Fetch Sensor data by date list
curl --location --request GET 'localhost:8080/v1/sensors/query' \
--header 'Content-Type: application/json' \
--data-raw '{
    "ids": ["100", "200"],
    "parameters": ["temperature", "humidity"],
    "dates":["2020-01-01", "2020-01-02" ]
}'
  1. Fetch Sensor data by date range
curl --location --request GET 'localhost:8080/v1/sensors/query' \
--header 'Content-Type: application/json' \
--data-raw '{
    "ids": ["100", "200"],
    "parameters": ["temperature", "humidity"],
    "dateRange":{ "from":"2020-01-01", "to":"2020-01-02"}
}'

Fetch data from Kafka Broker

A kafka consumer service will run with the application to fetch event information from topic : sensorData

Configuration of kafka broker can be configured from genesys_rt/src/main/resources/application.yml

Message structure to consume data

{ "sensorId":100, "temperature":1.1, "humidity":1.1,"timestamp":"Tue, 6 Dec 2016 19:06:33 IST"}

genesys_rt's People

Contributors

tragait avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.