-
Notifications
You must be signed in to change notification settings - Fork 20
Built in Status Datastreams
A system/procedure can enable the built-in status datastream to report internal status of all other data streams that it generates.
The record is sent regularly (or irregularly depending on next heart beat) as a heart-beat and is structured as so:
- timestamp
- output name
- status code (ENABLED, DISABLED, INTERRUPTED, ENDED)
- next expected heart-beat timestamp (or special value if unknown, e.g. when source is turned-off)
- custom message string
The FOI of each record is the Datastream itself, corresponding to the output. So FOI ID = Datastream ID and we can reuse our generic obs database to store status.
An MQTT source can rely on the protocol keep-alive timeout and PINGREQ to detect a half-open connection.
The status code should be set to:
- ENABLED when the client connects
- DISABLED when the client disconnects cleanly
- INTERRUPTED when a PING hasn't been received before the keep-alive timeout
Websocket also has a PING/PONG mechanism that can be used as a heartbeat.
- ENABLED when the client connects
- DISABLED when the client disconnects cleanly
- INTERRUPTED when a message or PING hasn't been received before the timeout
- ENABLED when the first POST is received
- DISABLED when no POST requests received before timeout (how to set timeout?)
The same datasource can sometimes connect via different types of connections with different protocols or networks. For example switching between 4G, satellite and WiFi.
In most cases, the datasource will use one connection at a time, but switching between them can cause disconnect/connect events and can even lead to receiving duplicate messages temporarily. How do we make sure the connect is reported after the disconnect so the latest status can be properly reported?