Hello,
first of all, thanks in advance for taking your time to answer this question.
What am I trying to achieve:
I am currently streaming data from an IoT Device via MQTT towards telegraf and writing the generated data into a database within InfluxDB (Working so far).
Influxdb is supposed to be acting as a buffer system. So store the data for e.g. 7 days.
After the data is stored in the InfluxDB I want to periodically query against the database and extract the data from it, then publish the data to an MQTT Broker (Microsoft Azure IoT Hub). After the data will be processed within Microsoft Azure (e.g. Machine Learning etc).
Example:
Lets assume I am sending Temperature Data in a json format once a second via MQTT:
{“datetime”: “2020-01-19 22:15:00”, “name”: “TempSens1”, “value”: 25.9}
{“datetime”: “2020-01-19 22:15:01”, “name”: “TempSens1”, “value”: 27.1}
{“datetime”: “2020-01-19 22:15:02”, “name”: “TempSens1”, “value”: 22.0}
And it is stored like this in the InfluxDB.
Now a query should be executed every 1 second to extract the above json.
Each 1 second a MQTT message will be published towards the Azure IoT Hub MQTT Broker.
Question:
Are there any options within the TICK Stack to achieve this?
Telegraf seems to have a MQTT Output Plugin, but I am not sure how to configure it properly for this task. Kapacitor has some functionalities for achieving this in the context of alerts, but I don’t think it is applicable to what I am trying to do.
If there are no built-in options in the TICK Stack has anyone tried something simliar with other tools?