Open diconico07 opened 1 year ago
I created a reference implementation of a Discovery Handler for this proposal, you can find it at suse-edge/akri-mqtt-discovery-handler.
I took a quick look at all previous discussions regarding this topic and the new proposal. Based on my knowledge, as I work with sub-components of cutting and welding machines that use MQTT, the new proposal from @diconico07 is precise to discover the MQTT-supported devices/machines in the shopfloor backed by a common external MQTT broker running on a centralized location, for eg, on a factory server and also to advertise the discovered device resources to Kubernetes based consumer applications.
One thing to note is that the MQTT Discovery Handler doesn't need to run on every node of the cluster. It is only relevant for something like UDEV device discovery. Every MQTT Discovery Handler is a client of the same MQTT broker in the network. It is better to have a cluster-wide Discovery Handler for this use case.
One thing to note is that the MQTT Discovery Handler doesn't need to run on every node of the cluster. It is only relevant for something like UDEV device discovery. Every MQTT Discovery Handler is a client of the same MQTT broker in the network. It is better to have a cluster-wide Discovery Handler for this use case.
I do not completely agree on this, while in theory you can, you may not want to, as if you lose connection between a node or set of nodes and the MQTT broker, then having a DH per node ensures the workload will be on the working nodes.
Moreover, the current agent architecture doesn't allow to have remote/centralized discovery handlers.
I agree with you.
Few more tricky but possible scenarios are,
Two or more devices (same machine models from a manufacturer) publishing using same topic and one of the topic payload contains the differentiator like Device/Model ID.
I have machine here from a manufacturer that doesn't even differentiate two same models but different devices at topic or payload level.
@shantanoo-desai copying you here in case you have any thoughts given you've been thinking about Akri + MQTT for awhile
This is a new proposal for an MQTT Discovery Handler, this proposal tries to keep things as simple as possible while still solving most use cases
This is part of project-akri/akri#106