thin-edge / thin-edge.io

The open edge framework for lightweight IoT devices
https://thin-edge.io
Apache License 2.0
221 stars 54 forks source link

Support createBulk C8Y JSON topics #3203

Open zhongys-c8y opened 3 days ago

zhongys-c8y commented 3 days ago

Issue description A customer wants to send bulk measurements via thin-edge, each measurement has different timestamps. The current thin-edge JSON format can include timestamp only on the top level. But C8Y JSON supports createBulk.

Then I found that thin-edge dosen't support createBulk topics out-of-the-box.

Workaround User can still use createBulk topics by:

  1. Add the topic into c8y-bridge.conf, for example: topic measurement/measurements/createBulk out 2 c8y/ ""
  2. Restart mosquitto service: systemctl restart mosquitto.service Then thin-edge can forward the measurements to the platform. But thin-edge will lose this custom config after reconnecting tedge.

Expecting solution It would be great if thin-edge can support createBulk topics natively. According to C8Y documentation, C8Y supports: event/events/createBulk alarm/alarms/createBulk measurement/measurements/createBulk

reubenmiller commented 2 days ago

Note: During development each of the added endpoints should be checked if they do work as intended (e.g. if they do create the telemetry data in Cumulocity). There is the possibility that the Cumulocity docs are not 100% correct, as there is some doubt on the functionality behind the alarm/alarms/createBulk and event/events/createBulk topics.