Documentation

FairCom MQTT Support

Next Topic

MQTT Overview

Developer's Guide

FairCom MQTT Support

Audience:

Developers

Subject:

Using MQTT to persist date into the FairCom Database Engine

Copyright:

© Copyright 2019, FairCom Corporation. All rights reserved. For full information, see the FairCom Copyright Notice.

 

Message Queuing Telemetry Transport (MQTT) is a simple message queuing system that is commonly used in Industrial Internet of Things (IIoT) solutions. MQTT Brokers listen for messages and pass messages on to subscribers of specific topics. IIoT Devices connect to and publish messages to an MQTT Broker. These messages contain sensor data, alerts, commands, etc. The MQTT Broker can process messages and/or relay them to systems that subscribe to specific message topics. Devices can also subscribe to and receive messages from an MQTT Broker, which are typically commands.

An MQTT message is published to a topic, which controls the flow of the message. For example, when a publisher, such as an IIoT device, has data to share, it can publish a message to a topic on an MQTT Broker, which then distributes the message to all clients that are currently subscribed to that topic. Publishers do not need to know about subscribers, and vice versa. If an MQTT Broker receives a message with a topic that has no current subscribers, it discards the message — unless the publisher indicates it wants the MQTT Broker to retain the message.

Using MQTT with c-treeEDGE

The FairCom c-treeEDGE IoT Database is a good example of how c-tree can be used with MQTT.

  • The FairCom MQTT Broker - c-treeEDGE includes a full-featured MQTT Broker that can store and forward messages like any other MQTT Broker. You can use any MQTT client library to send messages to c-treeEDGE. These messages can configure c-treeEDGE to receive and persist MQTT data messages as rows in tables in its local database. Once c-treeEDGE is configured to persist data for a specific topic, devices can publish data directly into FairCom’s Relational Database Engine simply by sending messages to the FairCom MQTT Broker.
  • The FairCom MQTT Client - c-treeEDGE also includes an MQTT client that can be configured to listen to messages from other MQTT Brokers. It can automatically extract data from these messages and store the resulting data in its database. It can also forward messages to other MQTT subscribers.

c-treeEDGE can be part of a data replication solution that automatically replicates data to other c-treeEDGE databases, MQTT subscribers, MQTT Brokers, and ThingWorx. This makes it easy to capture sensor data for local use and reliably forward it to other systems. IT departments can use the FairCom ODBC and JDBC features to extract, transform, and load data into their data warehouses, data marts, and operational databases.

At its core, c-treeEDGE is a SQL and NoSQL database. You can insert, update, delete, and query data through SQL and NoSQL APIs. c-treeEDGE provides graphical and command-line tools to make it easy for you to view, query, and manage your data.

Because c-treeEDGE provides SQL and NoSQL APIs for all major programming languages, an application can easily connect to the database, work with sensor data, make decisions, connect to the FairCom MQTT Broker and send messages back to devices. This makes it easy to provide real-time feedback to devices.

In This Chapter

Configuring a Persistent Topic

Example of a Configuration Message

Example of a Data Message

c-treeEDGE V2 MQTT Operation Support

TOCIndex