Back

MQTT client tools

2019-11-29

Overview

During learning and using MQTT, a handy client tool can greatly facilitate the user to explore the MQTT features and debug the functional components. Developers from all over the world have developed a number of client-side testing tools for the MQTT protocol around different operating systems.

These client tools come in a wide variety of ways, with different functional focus and uneven quality levels. Therefore, for beginners and even MQTT experts, how to choose a suitable MQTT client tool is a problem.

This article will collect as much as possible, and make a comprehensive evaluation of various MQTT client tools on the market for readers' reference.

Features required for MQTT client tools

MQTT client tools are often used to establish connections with MQTT Brokers for the operations of topic subscriptions and messaging. The features of an MQTT client tool can be evaluated from the following aspects:

  • In each usage phase, the tool needs to provide as much parameter configuration capabilities as possible, and use all the features of MQTT, so that users can respond to any usage scenarios and usage simulation tests. This part of the features include support for client authentication, support for configuration certificates and multiple encryption connection, support for the configuration of multiple parameters in the MQTT connection, publishing, and subscription process, support for MQTT 5, etc.
  • Enhance user interaction convenience on a full-featured basis;
  • Provide other extension functions, such as supporting multiple client connections and MQTT protocol debugging at the same time;
  • Cross-platform, available under different operating systems

This article will combine the features of each client tool to conduct evaluations from the above aspects. The client tools for the election are as follows:

  • Mosquito CLI
  • MQTTX
  • MQTT.fx
  • MQTT Box
  • mqtt-spy
  • MQTT Lens

Mosquito CLI

Mosquitto is an open sourced (EPL/EDL license) message broker. Mosquitto provides two command line MQTT client tools of mosquitto_pub and mosquitto_sub by default after installation.

Project address:Github Mosquitto

Download link:Mosquitto website

Mosquito CLI has multiple configuration options, supports TLS certificate connections via a proxy server, supports debug mode, and provides more detailed message information in debug mode.

Mosquito CLI is lightweight, compact, and easy to install, allowing multiple MQTT clients to be built in parallel with multiple connections to complete message publish/subscribe testing.

It is also very easy to use, only needs to provide a few parameters in the default use environment:

## Enable debug mode to subscribe to testtopic/# topic
wivwiv-mac:workspace emqtt$ mosquitto_sub -t "testtopic/#" -d
Client mosqsub/66418-wivwiv-ma sending CONNECT
Client mosqsub/66418-wivwiv-ma received CONNACK
Client mosqsub/66418-wivwiv-ma sending SUBSCRIBE (Mid: 1, Topic: testtopic/#, QoS: 0)
Client mosqsub/66418-wivwiv-ma received SUBACK
Subscribed (mid: 1): 0
Client mosqsub/66418-wivwiv-ma received PUBLISH (d0, q0, r0, m0, 'testtopic/1', ... (5 bytes))
Hello

## Publish a message to testtopic / 1 topic
mosquitto_pub -t "testtopic/1" -m "Hello"

For more information about the installation and use of Mosquitto and Mosquitto CLI, refer to Mosquitto website.

MQTT X

MQTT X is a cross-platform visual MQTT client tool developed by EMQ, which is open-sourced under Apache license 2.0 protocol.

Project address: Github MQTTX

Download link: Github MQTTX Release

MQTTX has the following features:

  • Able to create any MQTT Broker connection
  • Support for MQTT/WebSocket connections and MQTT/TCP connections
  • Support for subscribing to topics
  • Support for the sending and receiving of messages
  • Cross-platform desktop with support for Windows, MacOS and Linux

MQTTX is the latest product, which adopts the Electron cross-platform technology with a beautiful interface and low resource footprint. MQTTX changes the common single client mode in interaction, organizes client information according to the broker configuration, allows multiple client information to be saved in the same broker configuration, and sends and receives messages in the interactive form of message chat. It allows to establish multiple client connections at the same time and switch to communicate with each other by themselves, which has better interaction, and greatly improves the efficiency of interactive debugging.

1.png

As of now, MQTTX has released the v1.1.1 version, and more follow-up features are still waiting to be developed.

MQTT.fx

MQTT.fx is a currently mainstream MQTT client developed by Jens Deters that can quickly verify whether it can interact with IoT Hub services to publish or subscribe to messages. MQTT.fx is applicable for the Apache License 2.0 protocol without providing source code.

Project address: source code not provided

Download link: MQTT.FX

MQTT fx has the following features:

  • Predefine message template
  • Obtain broker status via system topic $SYS (support HiveMQ and Mosquitto)
  • Memory of the most recently used topic
  • Support for JavaScript scripts via Nashorn Engine
  • Support log display, display log information in the connection
  • Cross-platform desktop with support for Windows, MacOS and Linux

MQTT.fx is an established MQTT client tool. All the cloud product provider related product documentation tutorials such as Azure IoT Hub, AWS IoT, and Alibaba Cloud IoT use MQTT.fx as an example. MQTT.fx is developed by JavaFX technology, and may have a stuck experience on some older machines because of Java virtual machine relationship.

In terms of basic functions, MQTT .fx can save multiple connection configurations, support multiple types of TCL encryption, and specify multiple types of certificates. When creating a connection, you can specify to use an HTTP proxy server. After the connection is successful, the entire publishing and subscription functions are relatively reasonable and smooth. It is a function highlight that the topics Collector function can find the topic of subscription through other means such as the Broker-side proxy. Mqtt.fx also supports the connection test of Google cloud IOT.

Among the advanced features, MQTT.fx's biggest highlight is to support the execution of JavaScript function scripts. With the JavaScript code written by Nashorn Engine users, users can access Java methods and field to implement function extension. After familiarizing with the MQTT.fx related APIs, users can write test scripts that adapt to the business, simulate sensor reporting data and even performance testing tools.

If you are using HiveMQ or Mosquitto Broker, MQTT.fx provides a dedicated tab to visualize Broker status by subscribing to both system topics (topics for publishing Broker run information) , and get information about the system version and time of the broker, the number of clients, the number of messages, network traffic, and load status.

In general, MQTT.fx has rich and mature functions, and supports all the configuration items that may be encountered in the TCP connection. Except for the poor interaction, users can only establish one connection at the same time, which cannot satisfy the simultaneous use demand of multiple test connections. In addition, it does not implement support for WebSocket, which cannot be used in the test scenario of MQTT over WebSockets.

2.png

MQTT Box

MQTT Box is an MQTT client tool developed by Sathya Vikram, originally only used in Chrome for browser expansion and installation. After rewritten for open source, it becomes a desktop-side cross-platform independent software.

Project address:GitHub MQTTBox

Download link: http://workswithweb.com/mqttbox.html

MQTT Box has the following features:

  • Easy to install with support of Chrome OS, Linux, Mac OS, Windows' Chrome , Mac OS, support stand-alone installation with Linux, Mac OS, Windows
  • Support MQTT, MQTT over WebSocket, multiple TCP encryption connections
  • Save the sent history
  • Copy/paste messages in history
  • Save subscription message history
  • Simple performance testing, testing the load of the broker and visualizing the test results through chart visualization

MQTT Box also adopts Electron cross-platform technology. The interface is simple and direct, and supports multiple clients to be online at the same time. However, the interaction and messaging between clients is still inconvenient. MQTT Box is a worthwhile MQTT client tool with the powerful cross-platform features of Chrome combined with simple load testing.

3.png

mqtt-spy

Mqtt-spy is part of Eclipse Paho and Eclipse IoT, which runs on top of Java 8 and JavaFX by directly launching JAR files. Mqtt-spy has a good way of interaction to show the basic MQTT publish/subscribe mechanism.

Project address: GitHub mqtt-spy

Download link:https://github.com/eclipse/paho.mqtt-spy/releases

Mqtt-spy has the following features:

  • Support for MQTT and MQTT over WebSocket
  • Easy to interact, publish and subscribe at the same time, connect multiple brokers on different tabs
  • Able to close different areas of the pub/sub window (publish, new subscriptions, subscriptions and messages) to make room for the space currently in use
  • The search function allows searching for commonly used MQTT messages, allowing output of publish/subscribe messages to standard output or logging to a file for subsequent analysis

Mqtt-spy does not provide a separate installation package, which need to install the Java runtime environment before using it. But after launching, mqtt-spy has a friendly hands-on experience, and the boot guide feature is eye-catching. MQTT newbies can easily connect to the public MQTT Broker using mqtt-spy for exploration. The function interface of mqtt-spy is slightly complicated, but after familiar with the function of each component, it will become a development and debugging tool. It is also worth mentioning that the performance and stability of mqtt-spy are poor. It is also possible that the version used by the author is the latest beta version. After connecting multiple brokers, there are frequent crashes and suspended animations.

4.png

5.png

MQTT Lens

MQTT Lens is a Chrome extension tool that can be installed from the Chrome Web Store. MQTT Lens interface is very compact and provides basic publish and subscribe functionality.

Download link: Chrome Web Store

MQTT Lens has the following features:

  • Accept connections to multiple brokers at the same time, with different color associations
  • The interface for subscribing, publishing and viewing all received messages is very simple and easy to use
  • Support for MQTT and MQTT over WebSocket

MQTT Lens is simple enough, and provides the fundamental MQTT and MQTT over WebSocket connectivity to quickly get started.


Welcome to our open source project github.com/emqx/emqx. Please visit the documentation for details.