Leveraging the built-in MQTT Broker
MQTT Broker Modules
Every Crosser Node comes with a built-in MQTT broker. The obvious use of this broker is if you have data sources that can publish data on a MQTT broker and you want to use this data in a Flow. Instead of installing a separate broker outside Crosser, you can use the already available broker, without any extra installation. Same thing if you want to send data from your Flows to systems that can subscribe to MQTT topics, just publish the data on the internal broker and let the other systems pick it up from there.
Communicating with the built-in broker from your Flows is done with the MQTT Sub/Pub Broker modules. There’s a corresponding set of modules for communicating with external brokers: MQTT Sub/Pub Client.
There’s also another very useful scenario: Using the broker to communicate between your Flow, either Flow running on the same Node, or Flows running on different Nodes.
A common design pattern is to have an input Flow that gets data from your external sources and maybe do some basic transformations and clean-up. It then publishes the data on the internal broker. Then you can add multiple Flows that use the data, e.g. one Flow that runs an ML model that derives new settings fed back to machines in a closed loop, and another that aggregates a subset of the data and sends it to the cloud for visualization or further analysis.
Breaking up applications into multiple Flows can make the applications easier to manage, both by making each Flow simpler, but also to allow adding new applications that need to use the same data without affecting existing Flows. The same concept can be used across Nodes, by letting a Flow on one Node send data to the broker on another Node.
MQTT Modules
MQTT Pub BrokerThe module is used to publish messages to MQTT clients subscribing to a matching topic in the Crosser MQTT broker. It will also be possible to call other flows that have a MQTT Subscriber module with a matching topic. |
|
MQTT Sub BrokerThe module is used to subscribe to MQTT messages that are sent to the Crosser server from connected MQTT clients. You can also send messages to this module by using the MQTT publisher module from another flow. |
|
MQTT Pub ClientThe module is used to publish messages to external MQTT brokers. |
|
MQTT Sub ClientThe module is used to subscribe to MQTT messages from an external MQTT broker. |