Giter Club home page Giter Club logo

weathersystem's Introduction

Weather System

Weather system is a set of services which allows a user to manage weather stations and weather reports. User can list, create, update or remove weather stations using desktop application. She or he can also check log files to read current weather report on the weather station. Fetching weather report is done through scheduler service developed on backend server. Integration and logging is done thought MQ server and enterprise service bus. An enterprise service bus (ESB) implements a communication system between mutually interacting software applications in a service-oriented architecture (SOA). It represents a software architecture for distributed computing[1]. Whole system is consisted from three main parts:

  • Client application for managing weather stations
  • Server which handles all logic regarding weather stations, and also it's reading weather reports and send them to MQ server
  • Enterprise service bus which glue all systems to work together

Getting started

To be able to run the project successfully, several technologies and programs are required.

Prerequisites

For running the project, you need to have the following items:

  • ActiveMQ
  • Mule ESB Anypoint Studio
  • Java/JDK 17

Maven is included as Maven wrapper inside WeatherSystemServer directory.

Running

This project require that every component of a project is running.

Active MQ

ActiveMQ is used as a connection through which the backend server sends weather report to ESB. This is usually the case with older IOT systems, which can only communicate through a messaging system. ESB listens to every new weather report message and store them to the log files.

Start ActiveMQ with default settings (port = 8161). Spring Boot server (when started) will automatically send MQ messages, as shown on image below.

No extra settings are required - MQ queue will be automatically crated.

Spring boot backend

Open WeatherSystemServer directory and run the following command to start the server:

./mvnw spring-boot:run

Note, Java 17 is required for successfully running the above command. Maven wrapper which is included in the project will automatically fetch all required dependencies, and it'll start the server at port 8085.

Server will expose CRUD REST API for managing weather stations. Those operations and statuses could be easily tested with Postman by importing WeatherSystem.postman_collection.json file as Postman collection. All CRUD operations from the server will be in HAL JSON format.

The server will also generate weather reports using scheduler every 20 seconds, and send them to MQ using JMS.

Mule ESB

Open Mule Anypoint Studio and import project from WeatherSystemESB directory. ESB is the main glue for connecting all systems to work together. Flows are separated to three different semantic units described in following paragraphs.

Station API flow

Flow which define connection between client application and backend service. All requests from the client go through ESB and are redirected to the server. The server will respond in HAL JSON, which will then be transformed to basic JSON (in ESB) for easily integration. All requests are logged by Logger flow. In flow there is also "choice" component which implements routing operations.

MQ flow

MQ flow consist of listener for the new MQ messages, transformer which transform message to more readable format and call to Logger flow which will log output of MQ message.

Logger flow

Flow responsible for logging the actions. All actions are saved in log.txt file.

JavaFX client

Client application is responsible for managing weather stations. User can list, add, edit or remove weather station. Fronted is written using Java FX library.

Open WeatherSystemClient directory and run the following command to start the application:

mvn clean javafx:run

If the above command does not work, the application could be started using Java IDE (ex. IntelliJ IDEA). There are some known issues when running the application without IDE.

Business process diagrams

Image below show one of business process for using this system. Diagrams are created and executed in jBPM.

jBPM (Java Business Process Model) is an open-source workflow engine written in Java that can execute business processes described in BPMN 2.0.

Dependencies

Several technologies were used while developing this system:

  • ActiveMQ
  • MuleESB
  • Spring Boot
  • JavaFx
  • Spring Data
  • Repository REST
  • JPA
  • JMS
  • Scheduler
  • RestTemplate
  • H2
  • Lombok

Licence

See the LICENSE file. For every question write to [email protected]

weathersystem's People

Stargazers

 avatar

Watchers

 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.