Closed pchainho closed 7 years ago
One possible way to do this, maintaining the REST interface:
To request notification
When there is a change:
Status update: -Methods mostly implemented in the Domain Registry. Still missing database storage. -Connector still Work In Progress -Runtime still WIP
@pchainho When the runtime receives the notification, from the message node, that the hyperty is back, what should happen?
@pchainho, what do need to implement here from the connector side? The specs only define a message to the Message Node Subscription Manager.
As far as I remember, the connector only has to publish status changes:
But there is this message also: https://github.com/reTHINK-project/specs/blob/master/messages/registration-messages.md#subscribe-to-receive-notifications-about-registration-status-changes
Is the Subscription Manager that contacts the Domain Registry directly?
No, it is the MN that broadcasts the published status change to all subscribers using pub—sub
In order to this to work is still necessary to implement the "notification" functionality in the Runtime side. Our proposal of API that should be exposed by the Service Framework is simple:
subscribe(<URL_to_subscribe>, <subscriber>, callback)
unsubscribe(<URL_to_unsubscribe>, <subscriber>)
From the Runtime <-> Subscription Manager comunication, this will have the following interactions:
subscribe
function is called a message is sent from the Runtime to the Subscription Manager (detailed here).subscribe
function by calling the associated callbacks.@pchainho seems ok?
As discussed in Slack I would propose a more developer friendly API in the service framework discovery lib, where each returned discovered object will support a onLive()
and a onDisconnect()
event handler.
This issue is complete.
The changes are in branch: hyperty-notification
(service-framework); disconnected-hyperties
(runtime-core); connector-release-1.0.0
(msg-node-vertx); 32-connector-sm
(registry-domain).
This issue will be closed after the next release.
We are replicating the notifications feature to data objects.
Notification feature is now available not only for hyperties but also for data objects.
The changes are in branch: hyperty-notification
(service-framework); disconnected-hyperties
(runtime-core); connector-release-1.0.0
(msg-node-vertx); 32-connector-sm
(registry-domain).
This issue will be closed after the next release.
I've found some issues when testing with UserAvailability Hyperties at hyperty-notification branch from dev-hyperty repo:
runtime.registry.unregisterAllHyperties();
in the browser console I receive a "not found" response:then, if from HypertyAvailabilityObserver side I try to discover this Hyperty, I got results with "status = live":
onDisconnect
event when the Hyperty registration expires (after 30 secs)Hi @pchainho .
The resource
field is wrong. Should be only: hyperty://localhost/cc5a34be-d08b-4ff6-a21b-7859690b85b5
.
And that is correct, according to the implementation. The HeartBeatThread
runs only after one hour. So, unless you make a GET request for the hyperty that validates the expire field, you should wait for the HeartBeatThread
.
This issue should be fixed in later versions.
Closing for now.
As discussed here