FairCom Edge includes an MQTT (Message Queuing Telemetry Transport) Plug-in that transforms the hub into an MQTT Broker with the ability to cache MQTT messages in relational tables for easy integration with other systems.
This chapter is a brief MQTT reference to get you started quickly.
MQTT (Message Queuing Telemetry Transport) is a lightweight protocol allowing small pieces of data to be transferred from machine to machine across networks. MQTT works well even on low bandwidth, high latency connections, which makes it ideal for the Internet of Things (IoT).
MQTT communication consists of a publisher, a broker, and a subscriber:
Any number of publishers can be sending messages on one or more topics. Any number of subscribers can be listening for one or more topics. All messages for a particular topic will be sent to all clients subscribed for that topic regardless of where they were sent from. The broker, publisher, and subscriber can be on the same machine or different machines.
The FairCom Edge MQTT Broker is a generic broker for connecting c-tree as a persistent data store under an MQTT application. It can be placed on smaller devices and gateways typically found near the sensors. It is used to persist MQTT message contents on the edge. By locating FairCom Edge on the edge, MQTT message contents can be persisted near the sensors where service is unaffected by the latency of the cloud.
Any of the JSON fields contained in a specified topic can be written automatically to a specified database table. This table is simultaneously available via a FairCom DB SQL server allowing ISAM and SQL connections to the persisted fields. Data continues to flow through the FairCom Edge Broker normally, going from publisher to subscriber while, at the same time, being stored in a database. Configure as many tables as you want each one collecting fields from different topics.
This allows full SQL access to some or all fields of data moving through the FairCom Edge MQTT Broker with very little change to standard MQTT setups.
MQTT uses System Topics to control its operation. These topics provide a variety of metadata about the operation of the queue as well as the location of a configuration file. This mechanism can be used to determine which topics will be persisted.
For more MQTT information, see mqtt.org.
Let's get started:
You will find important information about MQTT configuration in Configuring the MQTT Plug-in.
For an MQTT tutorial explaining messages and persistence topics, see Tutorial for MQTT: Configuring a Persistence Topic.
For using MQTT with Node-RED, see the section titled Node-RED Using the FairCom Edge MQTT Broker.
Additional information for Python developers using FairCom Edge is provided in Python Using FairCom Edge MQTT.
Note: For reference information about the supported MQTT operations, see the FairCom MQTT Reference Guide in the on-line documentation.