This app is a sample of an use case for Mqtt.
An industrial environment is monitored by a set of temperature sensors that sends the temperature every 60 seconds to a MQTT broker. Two services are linked to the broker: the Compute Average Temperature (CAT) service, which calculates the average of monitored temperatures, and the Alarms service, which triggers messages of various types of alarms (fire, high temperature, water flow) for human system operators.
- clone the repo
- run
yarn
to install dependencies - navigate to project folder using your terminal
- run
yarn sensor
to start the temperature sensor simulator - run
yarn cat
to start the Compute Average Temperature (CAT) service - run
yarn alarms
to see the log of the alarms been fires
- for this sample it's used a sensor sending a new temperature at each 2 seconds