MQTT Repositories Review – Mosquitto, MessageSight & More

In my previous blog (Rigorous Enough! MQTT For The Internet Of Things Backbone), I presented the MQ Telemetry Transport (MQTT) protocol, which helps provide the required communication for smart devices. But without a broker repository or destination to support the protocol, MQTT can’t complete its mission.

In this article, I’ll first review one of the open-standard MQTT repositories called Mosquitto, and then cover IBM MessageSight. In future blogs I’ll present additional information on both the security component and additional broker functionality.

Mosquitto is an open-source (BSD-licensed) message broker that implements the MQTT protocol versions 3.1 and 3.1.1. It provides a lightweight server implementation of the MQTT and MQTT-SN protocols, written in C, so it can run on machines that can’t run a JVM.

Mosquitto regularly has an executable in the order of 120kB that consumes around 3MB RAM with 1,000 clients connected. There have been reports of successful tests with 100,000 connected clients at modest message rates.

In addition to accepting connections from MQTT clients, Mosquitto can bridge to other connected MQTT servers, including other Mosquitto instances. It’s thus possible to architect MQTT server networks, and pass MQTT messages from any network location to any other.

A second repository for MQTT is IBM MessageSight, which is built for high performance to offer persistent, transactional messaging. The hardware is 2U form factor. IBM MessageSight includes built-in security to enable integration with external Lightweight Directory Access Protocol (LDAP) security systems. MessageSight also offers Transport Layer Security (TLS), Secure Sockets Layer (SSL), FIPS 140-2, NSA Suite B ciphers and Level 1 secure Crypotgraphic Store securities.

Fine-grained messaging-authorization policies restrict access based on combinations of: user or group, client identifier, protocol, network interface, listening address and/or port, client IP address or range and destination topic and queue name.

The MessageSight repository supports connectivity to WebSphere Message Broker via JMS and/or MQTT nodes. It also integrates with Java environments and with rich HTML5-based web applications. Additionally, MessageSight allows development of interactive mobile-messaging applications with IBM Worklight Studio Developer, which delivers:

  • Friendly APIs and libraries
  • MQTT clients and libraries for a variety of platforms (C- and Java-based APIs)
  • Libraries for Google Android and Apple iOS
  • JMS client
  • JavaScript API for HTML5-based applications
  • PhoneGap MQTT plugins with JavaScript API for use with IBM Worklight
  • Apache Cordova
  • Adobe PhoneGap

MessageSight also offers simple and scalable management through policies. A single user ID is defined on the queue manager for IBM MessageSight, which enables a business to sense and respond to data coming from the edge of the enterprise. IBM MessageSight offers high availability with either an active or passive standby.

There are several public repositories that include Hive MQ, which provides a repository that anyone can engage with. In addition, there is cloudMQTT, which is a repository hosted in the cloud. There are other implementations of the broker space, namely gnatMQ, which is an implementation of MQTT but specifically for.Net, and ActiveMQ, which is a product of the Apache group.

Rigorous Enough! MQTT For The Internet Of Things Backbone

The topic of mobile devices and mobile solutions is a hot one in the IT industry. I’ll devote a series of articles to exploring and explaining this very interesting topic. This first piece will focus on MQTT for the Internet of Things – a telemetry functionality originally provided through IBM.
MQTT provides communication in the Internet of Things – specifically, between the sensors and actuators. The reason MQTT is unique is, unlike several other communication standards, it’s rigorous enough to support low latency and poor connectivity and still provide a well-behaved message-delivery system.
Within the Internet of Things there’s a universe of devices that provide inter-communication. These devices and their communications are what enables “smart devices,” and these devices connect to other devices or networks via different wireless protocols that can operate to some extent both interactively and autonomously. It’s widely believed that these types of devices, in very short time, will outnumber any other forms of smart computing and communication, acting as useful enablers for the Internet of Things.
MQTT architecture is publish/subscribe and is designed to be open and easy to implement, with up to thousands of remote clients capable of being supported by a single server. From a networking standpoint, MQTT operates using TCP for its communication. TCP (unlike UDP) provides stability to message delivery because of its connection-oriented standard. Unlike the typical HTTP header, the MQTT header can be as little as 2 bytes, and that 2 bytes can store all of the information required to maintain a meaningful communication. The 2 bytes store the information in binary using 8 bits to a byte. It has the capability to add an optional header of any length. The 2 bytes of the standard header can carry such information as QOS, type of message, clean or not.
The quality-of-service parameters control the delivery of the message to the repository or server. The options are:

Quality-Of-Service Option Meaning
1 At most once
2 At least once
3 Exactly once

These quality-of-service options control the delivery to the destination. The first 4 bits of the byte control the type of message, which defines who’ll be interested in receipt of these messages. The type of message indicates the topic of the message, which will manage who receives the message. The last element will be the clean byte, which like the persistence in MQ will determine whether the message should be retained or not. The clean option goes a step further in that it will also tell the repository manager whether messages related to this topic should be retained.
In my next blog I’ll discuss the broker or repository for these messages. There are several repositories that can be used, including MessageSight and Mosquitto among others. The beauty of these repositories is their stability.
(Photo by University of Liverpool Faculty of Health & Life)