Giter VIP home page Giter VIP logo

sensormanagerexample's Introduction

SensorManagerExample

This is an example of a little application that manage different sensor stations using multiple services that interacts with AMQP and expose a REST API interface.

There are two type of services:

The first type is the "SensorStation".

This service represents a service that manage a set of sensors mounted in a room. The service read data from sensors send it to another service ("SensorManager") through RabbitMQ. Sensor are mocked internally at the service with random generators) Every station have 2 sensors: (Oxygen, Humidity) In this example we is used the topic exchange type of RabbitMQ where the routing-key is composed by sensor.station-name (e.g. oxygen.station1)

The second type of service will be the "SensorManager".

This service have two purpose:

  • Collect data from the registered "SensorStation"s through RabbitMQ
  • The service keeps in memory only 10 last values of each sensors (you can choose what data structure use e.g list, queue, set ecc..)
  • Offers a REST interface that can be used by a generic User Application:
    • Add a new station, when this api is used the station manager add a listener to the value sent from the new station.
      The name of the station will be sent in the body of the message
      • POST: http://{hostname}:{port}/addstation
    • Get all station info (name + current sensors values)
      • GET: http://{hostname}:{port}/stations/
    • Get info of a specific station
      • GET: http://{hostname}:{port}/stations/station_name
    • Get the sensor values of a station
      • GET: http://{hostname}:{port}/stations/station_name/sensor_name/

In the file "UserInteractionSimulator.kt" there is a function that simulate a generic User App that interact with the REST interface of the "SensorManager".

This is one of the code examples created for the course in "Distributed Systems".

authors: Matteo Gabellini & Elia Di Pasquale

sensormanagerexample's People

Contributors

mattigabo 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.