Skip to content

Middleware

Oihana Garcia Anakabe edited this page Jun 22, 2022 · 4 revisions

Introduction

The middleware is the main developed component in this project. Middleware is the software that connects different components or applications with each other.


On the one hand, the developed middleware works as an integration tool, connects external and internal applications, sharing and streaming data among the components and the services in an asynchronous way. On the other hand, the middleware can support runtime for the use cases of this project, working agilely across services and the internal components, making the middleware behave as a new application on its own.

SOA Architecture

SOA (Service Oriented Architecture) is an essential function for software evolution, development, and integration. The following diagram represents the architecture used to build this middleware. The services, data bus, and other components are represented below.

Runner service

The runner service receives the commands to set up the other services. When the project is initialized, the runner subscribes to a broker to listen to the client’s orders. The client can start different services with customized features and also stop them. So, the runner is the service that enables the communication between the users and the middleware. The user can set the new properties from Thingsboard and publish the message. The initialization or deactivation can be done anytime because of the SOA architecture. All the services are independent, so if a service is added or quitted, it will not affect the performance of the middleware.

Sensor service

This service facilitates the communication between the sensors and the monitor service. The sensor service contains a subscriber; this component works as a listener to the MQTT broker and receives the data to monitor. Sensor messages arrive in a JSON format, which must be transformed to a Message.java.

Moonlight service

This is the service that contains most components.

  • Buffer: The buffer type implemented is a fixed size buffer. The sensor messages are saved, and when the buffer arrives at the length value, all the values are collected to join them and monitor them all together, letting the buffer empty and ready to receive more messages.
  • Conversion – Message to Increment: After collecting the necessary amount of information, the values need to be converted to monitor. The increment is represented by a TimeChain.java class.
  • Moonlight monitor: Lastly, Moonlight monitors the TimeChain and the middleware gets the SpaceTimeSignal with the monitor analysis.

Thingsboard service

The dashboard service is in charge of displaying everything that is happening in the system to the user. This service receives the state of the sensors and the results of the Moonlight monitor.

Clone this wiki locally