-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Consider adding "poll hook" to registration (pull keepalive) #164
Comments
The webhook could work only if the directory has networking access to such endpoints. In IoT environments, the devices are often behind firewalls that don't allow incoming connections. We should probably look into other protocols and for simplicity, decouple it from the directory. E.g. using MQTT, a client could listen to heartbeats from devices (sent to a broker) and update the respective registrations in the directory. |
Two (related?) issues:
Related to (a solution to) #464 |
Note that the current spec already has a way to do an "empty" TD update to extend the TTL; this is the current HTTP-based mechanism for a heartbeat update. But maybe it is too complicated and we need another (simpler) API entry point to for a Thing to "check in"? Also it would be nice to easily check if a Thing is available. Right now this can be done by pulling the TD and checking the expiry and last updated times but that seems overly expensive. Perhaps a special "query filter?" Also - the "modified" time is a bit ambiguous. If an empty patch is done for an update, does this change the "modified" time or not? What if only the TTL changes but not the rest of the TD - is that a modification? The document is not clear on this point, it only says the "expiry" time is updated on an empty patch. At least a clarification is needed, and/or a new piece of metadata to record "last heartbeat". |
In some protocols, there can be defined ways to do heartbeat.
In Sparkplug (built on top of MQTT), there is a birth message concept and each time a node becomes online, it sends a list of topics it is going to publish, which is for me a dumbed down version of a TD with MQTT binding. |
I think MQTT features such as retained messages (last message per topic persisted on the broker) and last will and testament (LWT) (a predefined message that broker publishes on behalf of the client on disconnection) are very helpful for realizing such functionality. The retained messages enable the directory to get the latest information even if the directory has been offline during the update. The LWT, makes it easy to know as soon as devices go offline. |
Assuming we add the TTL/expiry, it is the registering Thing's responsibility to update the TD in the directory before it expires. In other cases it might be useful for the directory to attempt to retrieve an updated TD automatically (and extend the expiry if it is successful).
Basically what I'm thinking is that a device can register a TD along with a "pollURL" and "pollInterval" attribute. The first is a location from which a TD can be retrieved, the second is how often (this value should be less than the expiry interval).
To discuss:
The text was updated successfully, but these errors were encountered: