Fabryprog / historical-stream

Simple nodejs application to create a historical message broker pub/sub (using mqtt)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Historical Stream Data

Using MQTT to retrieve historical data (without db)

Node.js usage

Install node.js dependencies

npm install

Edit config file (config.js)

{
  "connection": {
    "url": "mqtt://localhost:1883"
  },
  "topic": {
    "listen": [
      "/test/+/topic"
    ],
    "suffix": "/historical-stream"
  },
  "max": 5
}
  • connection.url = Mqtt broker connection url
  • topic.listen = List of topic to support historical stream data
  • topic.suffix = Topic to send historical stream data
  • max = Max items on memory (every topic)

Launch

nodejs index.js

Docker

Build

docker build -t historical-stream .

Edit config file (config.js)

Launch

docker run --name historical-stream -v $PWD/config.js:/usr/src/app/config.js historical-stream:latest

About

Simple nodejs application to create a historical message broker pub/sub (using mqtt)

License:Apache License 2.0


Languages

Language:JavaScript 84.4%Language:Dockerfile 15.6%