thin-edge.io
thin-edge.io copied to clipboard
New MQTT request API lighter than existing cmd interface
Is your feature request related to a problem? Please describe.
For things like health check, we currently use the cmd
topic channel, but the use of cmd
APIs is too heavy for such things. For example, all commands are expected to be retained messages, with an initial init
state, an intermediate executing
state and successful
or failed
terminal states. On receiving a health check request, a component just needs to send a te/.../status/health
response and doesn't need to go through all these states. So, it'd be better to have another request/prompting mechanism which doesn't have the overhead of commands.
The same prompting mechanism can be used to trigger other actions on the device, like asking the device to refresh certain measurements by generating them again, set some property etc.
Describe the solution you'd like
Introduce a new request topic channel: te/.../req/<request-type>
on which different kinds of requests can be sent, with different request types. The health check request on this new channel would be as follows: te/.../req/health_check
to which the receiving component can just respond with the te/.../status/health
message.