Skip to main content Skip to footer

Best Practice

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

Crosser MQTT Pub Broker Module

MQTT Pub Broker

The 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.

Crosser MQTT Sub Broker Module

MQTT Sub Broker

The 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.

Crosser MQTT Pub Client Module

MQTT Pub Client

The module is used to publish messages to external MQTT brokers.

Crosser MQTT Sub Client Module

MQTT Sub Client

The module is used to subscribe to MQTT messages from an external MQTT broker.

About the author

Goran Appelquist (Ph.D) | CTO

Göran has 20 years experience in leading technology teams. He’s the lead architect of our end-to-end solution and is extremely focused in securing the lowest possible Total Cost of Ownership for our customers.

"Hidden Lifecycle (employee) cost can account for 5-10 times the purchase price of software. Our goal is to offer a solution that automates and removes most of the tasks that is costly over the lifecycle.

My career started in the academic world where I got a PhD in physics by researching large scale data acquisition systems for physics experiments, such as the LHC at CERN. After leaving academia I have been working in several tech startups in different management positions over the last 20 years.

In most of these positions I have stood with one foot in the R&D team and another in the product/business teams. My passion is learning new technologies, use it to develop innovative products and explain the solutions to end users, technical or non-technical."

Close