MQTT: An Overview
MQTT (Message Queuing Telemetry Transport), is a publish/subscribe, simple and lightweight messaging protocol, designed for constrained devices and low-bandwidth by IBM / Eurotech in 1999. The simplicity and low overhead of the protocol make it ideal for the emerging "machine-to-machine" (M2M) or "Internet of Things" (IoT) world of connected devices, and for mobile applications where bandwidth and battery power are at a premium. The protocol is openly published with a royalty-free license, and a variety of client libraries have been developed especially on popular embedded hardware platforms such as arduino/netduino, mbed and Nanode.
In addition to Universal Messaging's own protocol, NSP and NHP interfaces are capable of also accepting MQTT connections over TCP sockets, while NSPS and NHPS interfaces can accept MQTT connections over SSL/TLS for client implementations that support it.
Connecting
In order to connect to a Universal Messaging server using MQTT, your application needs to
use a tcp://host:port URL (NSP and NHP interfaces) or ssl://host:port URL (NSPS and
NHPS interfaces). MQTT connections are treated in the same way as any other
connections by the Universal Messaging realm. If the username is present, the
Universal Messaging subject is username@hostname
, otherwise the
subject is anonymous@hostname
.

This way you can define realm and channel or queue ACLs as you would for any Universal
Messaging connection. For example using the IBM WMQTT sample application without a
username/password to connect to tcp://localhost:1883
will result in
a Universal Messaging subject of anonymous@localhost
.
Publishing
MQTT applications can publish events to channels. If the specified channels do not already exist in the Universal Messaging realm, they will be automatically created by the server as MIXED type with a JMS engine.
These channels are regular Universal Messaging channels but all events published from MQTT will be persisted to disk. While it is possible to create other channel types using the Administration API / Enterprise Manager, the mixed type with JMS engine is the recommended combination.
Events published via MQTT only contain a byte[] payload and are tagged MQTT. They are fully interoperable with any Universal Messaging subscriber on any client platform supported and can be snooped using the Universal Messaging Enterprise Manager:

All messages published from MQTT are flagged as JMS BytesMessage objects.
Subscribing
MQTT applications can subscribe to channels. If the specified channels do not already exist in the Universal Messaging realm, they will be automatically created by the server as MIXED type with a JMS engine.
These channels are regular Universal Messaging channels with all messages being persistent, regardless of whether they are published by MQTT or Universal Messaging applications.
Quality of Service
Universal Messaging supports QOS levels 0 and 1 as defined by the MQTT standard. This is driven by the MQTT client connection and describes the effort the server and client will make to ensure that a message is received, as follows:
- QOS 0 (At most once delivery): The Universal Messaging realm will deliver the message once with no confirmation
- QOS 1 (At least once delivery): The Universal Messaging realm will deliver the message at least once, with confirmation required.
Will
Universal Messaging supports connections with Will settings, which indicate messages that need to be published automatically if the MQTT application disconnects unexpectedly.