7 Best MQTT Client Tools Worth Trying
Find a suitable client tool for MQTT testing. Listed by desktop, browser, and command line categories, these tools are available for free (most, open source).
Join the DZone community and get the full member experience.Join For Free
With the rapid development of the IoT industry, the MQTT protocol is being used by more companies and developers. In the process of learning and using MQTT, a handy client tool can help developers debug IoT applications, explore the features of MQTT, and shorten the development cycle.
There are a wide variety of MQTT client tools with different functional focuses. For beginners and even MQTT experts, it is a challenge to choose a suitable MQTT client tool.
I've selected seven of the most useful MQTT client tools in 2022 and listed them by desktop, browser, and command line categories. All of these tools are available for free and most of them are open source.
I do hope this article will help you quickly find a suitable client tool for MQTT testing.
How To Choose an MQTT Client
MQTT client tools are commonly used to establish connections to MQTT brokers for message sending and receiving operations. Beyond this basic functionality, we think a good MQTT client tool should have the following features:
Support for one-way and two-way SSL authentication
Support for MQTT 5 features
Ease of use for all features
Support for multiple, simultaneous online clients
Cross-platform, available under different operating systems
Support for MQTT over WebSockets
Advanced features: Custom scripting, logging, payload format conversion, etc.
MQTT Desktop Clients
MQTT X is a cross-platform, open-sourced MQTT 5.0 client tool that can run on macOS, Linux, and Windows, and supports multiple payload formats.
It simplifies test operation with the help of a familiar, chat-like interface. It’s easy and quick to create multiple, simultaneous online MQTT client connections, and can test the connection, publishing, and subscription functions of MQTT/TCP, MQTT/TLS, MQTT/WebSocket as well as other MQTT protocol features.
MQTT X is dedicated to building an elegant, easy-to-use, full-platform MQTT client, and has recently released both MQTT X CLI and MQTT X Web. Now, MQTT X has reached 2K on GitHub Star.
Cross-platform for Windows, macOS, and Linux
Supports MQTT v3.1.1 and MQTT v5.0 protocols
Supports CA, self-signed certificate, and single and two-way SSL/TLS authentication
Supports theme switching between Light, Dark, and Night
Supports MQTT over WebSocket
Supports Hex, Base64, JSON, Plaintext
Supports English, Japanese, Simplified Chinese, Turkish and Hungarian
Supports custom color coding for topic subscriptions
Support for automatic subscription to $SYS and byte statistics
Customizable script to simulate data testing
Full logging capabilities
Download MQTT X on GitHub.
MQTT Explorer is a comprehensive MQTT client that provides a structured overview of your MQTT topics and makes working with devices/services on your broker dead simple.
MQTT Explorer supports difference comparison and visual chart display of received payload messages. Similar to MQTT.fx (below), MQTT Explorer can only create a single connection and cannot have multiple clients online at the same time.
Visualize topics and a dynamic preview of the change of topic
Delete retained topics
Recursive delete topics
Different views of current and previously received messages
Draw digital topics
Retains a historic record of every topic
Theme switching between Light and Dark
Download MQTT Explorer on GitHub.
MQTT.fx was originally developed by Jens Deters. In January 2021 MQTT.fx moved to Softblade - a new German company taking care of further development. It released a commercial version, MQTT.fx® 5.0. The MQTT.fx described in this article is the free 1.x version.
MQTT.fx is developed with JavaFX, supports saving multiple connection configurations, multiple types of encryption methods, specifies multiple types of certificates, and can set an HTTP proxy server when creating a connection.
In general, MQTT.fx has a rich, mature feature set and supports many configuration items in TCP connections, but users can only establish one connection at a time. In addition, it does not implement support for WebSockets and cannot be used to test MQTT over WebSockets.
Predefined message templates
Get the status of the broker through the system topic
Support log display, display log information in the connection
Cross-platform desktop with support for Windows, macOS, and Linux
MQTT Browser Clients
MQTT X Web
MQTT X Web is an open source MQTT 5.0 browser client and an online MQTT WebSocket client tool. Developers can use WebSockets to quickly connect to MQTT servers in the browser and debug MQTT services and applications faster without installing MQTT X.
MQTT Command-Line Tools
MQTT X CLI
MQTT X CLI is a fully open source MQTT 5.0 command-line client tool, i.e., MQTT X on the command line. This allows developers to develop and debug MQTT services and applications faster using the command line without the graphical interface.
Dependency-free: Get up and run with no prerequisites required
Easy to Integrate: Quick integration into automation test scripts
One and Two Way SSL: Support for one-way and two-way SSL authentication
The MQTT X CLI can be quickly downloaded and installed on macOS, Linux, and Windows systems without any environmental dependencies, simply by executing commands in a terminal. Also, for more information, check out MQTT X CLI on GitHub.
mqttx conn -h 'broker.emqx.io' -p 1883 -u 'admin' -P 'public'
mqttx sub -t 'hello' -h 'broker.emqx.io' -p 1883
mqttx pub -t 'hello' -h 'broker.emqx.io' -p 1883 -m 'from MQTTX CLI'
Publishing multiple messages:
mqttx pub -t 'mqttx/cli' -h 'broker.emqx.io' -p 1883 -s -M
The MQTT X CLI also supports a pub command to publish multiple messages, just add a -M parameter and a -s parameter to the command in the editor, and newline it after each entry.
NanoMQ is an ultra-lightweight, blazing-fast MQTT broker for IoT edge, which contains an abundant toolkit including broker, bench, conn, pub, and sub-client.
Supports performance testing
Supports MQTT 5.0
Ability to run on edge devices
Support reading file content as an MQTT payload
MQTT performance testing tool:
# Start 10 connections and send 100 Qos0 messages to the topic t every second, # where the size of each message payload is 16 bytes nanomq_cli bench pub -t t -h broker.emqx.io -s 16 -q 0 -c 10 -I 10 # Start 500 connections, and each subscribes to the t topic with Qos0 nanomq_cli bench sub -t t -h broker.emqx.io -c 500 # Start 100 connections nanomq_cli bench conn -h broker.emqx.io -c 100
# Send 100 Qos2 messages test to the topic t nanomq_cli pub -t t -h broker.emqx.io -q 2 -L 100 -m test # Subscribe nanomq_cli sub -t t -h broker.emqx.io -q 1
Mosquitto is an open-source implementation of an MQTT server for versions 5.0, 3.1.1, and 3.1 of the protocol. It also includes a C and C++ client library, and the
mosquitto_sub utilities for publishing and subscribing.
Mosquitto CLI has multiple configuration options, supports connections through a TLS certificate and a proxy server, supports debug mode, and can get more detailed message information in debug mode.
Lightweight command-line tool
Supports debug mode
Supports encrypted and nonencrypted connecting to MQTT broker
Easy to test in a remote server
For download, visit Mosquitto on GitHub.
mosquitto_sub -t 'test/topic' -v
mosquitto_pub -t 'test/topic' -m 'hello world'
Published at DZone with permission of Li Guowei. See the original article here.
Opinions expressed by DZone contributors are their own.