MQTT CLI 1.2.0 released

Written by Till Seeberger

Category: MQTT CLI MQTT Client HiveMQ MQTT Client

Published: April 8, 2020


The HiveMQ team is pleased to announce the availability of MQTT CLI 1.2.0.

This release expands the CLI with a new command to quickly test MQTT brokers and adds two output options for the subscribe command.

New Features

Test Broker Command

The new Test command can be used to quickly test the supported features and limitations of an MQTT broker. You can lookup all options of this command in the official CLI documentation.

# Use the test command against our public MQTT broker
$ mqtt test -h broker.hivemq.com
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
MQTT 3: OK
	- Maximum topic length: 65535 bytes
	- QoS 0: Received 10/10 publishes in 47,59ms
	- QoS 1: Received 10/10 publishes in 68,87ms
	- QoS 2: Received 10/10 publishes in 73,18ms
	- Retain: OK
	- Wildcard subscriptions: OK
	- Shared subscriptions: OK
	- Payload size: >= 100000 bytes
	- Maximum client id length: 65535 bytes
	- Unsupported Ascii Chars: ALL SUPPORTED
MQTT 5: OK
	- Connect restrictions: 
		> Retain: OK
		> Wildcard subscriptions: OK
		> Shared subscriptions: OK
		> Subscription identifiers: OK
		> Maximum QoS: 2
		> Receive maximum: 10
		> Maximum packet size: 268435460 bytes
		> Topic alias maximum: 5
		> Session expiry interval: Client-based
		> Server keep alive: Client-based

JSON Output for Subscribe

The Subscribe command now supports JSON formatted output. Simply include the -J option to format publishes that are received as JSON. If the payload is recognized as JSON, it is also formatted accordingly.

$ mqtt sub -t mqtt-cli -h broker.hivemq.com -J
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
{
  "topic": "mqtt-cli",
  "payload": {
    "product": "mqtt-cli",
    "type": "release",
    "version": "1.2.0",
    "feature-list": [
      "JsonOutput",
      "TopicOutput",
      "TestCommand"
    ]
  },
  "qos": "AT_MOST_ONCE",
  "receivedAt": "2020-04-02 11:15:10",
  "retain": true
}

Topic Output for Subscribe

When you subscribe to a wildcard topic, it is often useful to know from which specific topic a publish was received. The Subscribe command now supports a -T option to explicitly print out this topic with the publish message.

# Subscribe to the wildcard topic test/+ on our public MQTT broker with the -T option
$ mqtt sub -t test/+ -h broker.hivemq.com -T
1
2
3
4
5
6
test/pi: Honor 7c
test/bug: -3801340
test/tag1: oky
test/teste: alo
test/temp: 22
test/A0: 3

Improvements

  • Reading in password files with the -pw:file option now ignores trailing newlines.
  • The logging format and output of the logfile is now much tidier.

Miscellaneous

  • The jar file of a new release is now included in the release assets on GitHub.
  • The homebrew package size was decreased by half.



MQTT CLI 1.2.0 is supported on all main operating systems like Windows, OS X and Linux. You can find the installation instructions for your operating system in the official CLI documenation.

If you have any ideas on how to further improve the CLI or notice any bugs, please let us know on GitHub or send us a mail!

Have a great day,

Till from the HiveMQ Team

About Till Seeberger

Till Seeberger is a software developer at HiveMQ and maintainer of the MQTT CLI open-source project.
Contact Till

Guarantee Message Integrity between Kafka and MQTT
HiveMQ Enterprise Extension for Kafka 1.1.1 released