SparkplugB Spec > 8.Sparkplug™ MQTT Session Management and Message Flow
"In high availability and redundancy use cases where multiple MQTT Servers are used, MQTT EoN nodes need to be aware of whether Primary Applicationhas network connectivity to each MQTT Server in the infrastructure. If the Primary ApplicationSTATE shows that an EoN nodeis connected to an MQTT Server that the Primary Applicationis NOTconnected to, then the EoN nodeshould walk to the next available MQTT Server where STATE for the Primary Applicationis ‘ONLINE’."
Mission of FB_SparkplugHAProvider
An array approach with a "Sparkplug Server Connection" Type, which contains info for a Single server. High Availability (HA) can be more than 2 server connections,
3 is ideal. Maintain one, while still having a redundant pair.
Every connection is represented by a 1 "Sparkplug Server Connection"
In the Type we have various Server connection settings like IP adres, a port, login credentials and a pointer to specific TLS certificate etc, etc.
If a connection fails (see above), we use the next connection in the array.
FB_SparkplugB_ServerWalker will be refactored to FB_Sparkplug_HAProvider and parked for now as it is not part of the MVP product.
This FB is solely responsible for maintaining and monitoring of the High Availability functionality for use with the EoN. Ideally The EoN will not see any difference between an FB_MQTT or the HAConnMaintainer and thus no extra coding in the EoN should be neccesarry apart from the glue logic to make it tick.
The FB takes an array of SparkPlugBConnectionTypes and connects/monitors the connections according to the algorithm as outlined above. The FB uses composition to embed at least 2 instances of FB_MQTT type. It exposes the all mehods and properties of FB_MQTT type.
However, this strategy will cause this ticket to move back to at least the 2.0.0.0 Standard Product.
Diff:
Added attachment FB_SparkplugServerWalker.export which contains:
FB_SparkplugServerWalker &
SparkplugBServerConnectionType
for later usage
Diff:
Due to HA specs being too loosely defined within the SparkplugB spec, this extension is being parked until the spec gets updated or further notice
Last edit: hermsen 2021-10-23