MQTT Commands
Command Shape
robust-ctl mqtt [--server <admin-addr>] [--mqtt-server <mqtt-addr>] [--output table|json] [--page N] [--limit N] <subcommand>Common Subcommands
3.1 Overview and basic lists
Run the commands in this order when checking a broker: overview first, then sessions, subscriptions, connections, and topics. The examples below show the default table output captured from an isolated broker.
robust-ctl mqtt overview
robust-ctl mqtt overview📊 Cluster Overview
Cluster Name <run-id>
Message In Rate 0
Message Out Rate 0
Connection Num 1
Session Num 2
Topic Num 9
Subscribe Num 1
Connector Num 1
TCP Connections 3
TLS Connections 0
WebSocket Connections 0
QUIC Connections 0
🧩 Node List
Node ID Node IP Inner Addr Roles Start Time
1 127.0.0.1 127.0.0.1:<grpc-port> ["meta", "broker", "engine"] <timestamp>robust-ctl mqtt session list
robust-ctl mqtt session list+-----------+----------------+----------------------+--------------------------+-------------+---------------+-----------+----------------+---------------+
| client_id | session_expiry | is_contain_last_will | last_will_delay_interval | create_time | connection_id | broker_id | reconnect_time | distinct_time |
+===========+================+======================+==========================+=============+===============+===========+================+===============+
| <client-id> | 3 | false | 0 | <unix-time> | 4 | 1 | <unix-time> | 0 |
+-----------+----------------+----------------------+--------------------------+-------------+---------------+-----------+----------------+---------------+
| <client-id-2> | 3 | false | 0 | <unix-time> | 0 | 0 | 0 | <unix-time> |
+-----------+----------------+----------------------+--------------------------+-------------+---------------+-----------+----------------+---------------+robust-ctl mqtt subscribes list
robust-ctl mqtt subscribes listsubscribe list result:
+-----------+--------------+------+-----------+----------+-----+----------+-----------------+-----------------+-------------+-------+------------+
| client_id | is_share_sub | path | broker_id | protocol | qos | no_local | preserve_retain | retain_handling | create_time | pk_id | properties |
+===========+==============+======+===========+==========+=====+==========+=================+=================+=============+=======+============+
| <client-id> | false | <run-id>/messages | 1 | Mqtt5 | AtLeastOnce | 0 | 0 | OnEverySubscribe | <timestamp> | 1 | null |
+-----------+--------------+------+-----------+----------+-----+----------+-----------------+-----------------+-------------+-------+------------+robust-ctl mqtt client list
robust-ctl mqtt client listconnection list:
+-----------+---------------+----------+-------------+
| client_id | connection_id | protocol | create_time |
+===========+===============+==========+=============+
| <client-id> | 4 | MQTT5 | <unix-time> |
+-----------+---------------+----------+-------------+robust-ctl mqtt topic list
robust-ctl mqtt topic list📋 Topic List (Total: 9)
+-----------------------+---------------+-----------+-------------+---------------------+
| Topic Name | Storage Type | Partition | Replication | Create Time |
+=======================+===============+===========+=============+=====================+
| $delay-queue-index | EngineRocksDB | 3 | 1 | <timestamp> |
+-----------------------+---------------+-----------+-------------+---------------------+
| $SYS/events | EngineRocksDB | 3 | 1 | <timestamp> |
+-----------------------+---------------+-----------+-------------+---------------------+
| $last-will-message | EngineRocksDB | 3 | 1 | <timestamp> |
+-----------------------+---------------+-----------+-------------+---------------------+
| $retain-message | EngineRocksDB | 3 | 1 | <timestamp> |
+-----------------------+---------------+-----------+-------------+---------------------+
| $delay-queue-message | EngineRocksDB | 3 | 1 | <timestamp> |
+-----------------------+---------------+-----------+-------------+---------------------+
| $agent-report-info | EngineRocksDB | 3 | 1 | <timestamp> |
+-----------------------+---------------+-----------+-------------+---------------------+
| $sys/qos2-inner-topic | EngineRocksDB | 3 | 1 | <timestamp> |
+-----------------------+---------------+-----------+-------------+---------------------+
| $delay-task-index | EngineRocksDB | 3 | 1 | <timestamp> |
+-----------------------+---------------+-----------+-------------+---------------------+
| <run-id>/messages | EngineRocksDB | 3 | 1 | <timestamp> |
+-----------------------+---------------+-----------+-------------+---------------------+Pagination is applied before the request is sent. For example:
robust-ctl mqtt --page 2 --limit 50 session list
robust-ctl mqtt --page 2 --limit 50 session list+-----------+----------------+----------------------+--------------------------+-------------+---------------+-----------+----------------+---------------+
| client_id | session_expiry | is_contain_last_will | last_will_delay_interval | create_time | connection_id | broker_id | reconnect_time | distinct_time |
+===========+================+======================+==========================+=============+===============+===========+================+===============+
+-----------+----------------+----------------------+--------------------------+-------------+---------------+-----------+----------------+---------------+robust-ctl mqtt --output json --page 1 --limit 20 client list
robust-ctl mqtt --output json --page 1 --limit 20 client list{
"data": [
{
"tenant": "default",
"client_id": "<client-id>",
"connection_id": 4,
"mqtt_connection": { "is_login": true, "login_user": "admin" }
}
],
"total_count": 1
}3.2 User management
robust-ctl mqtt user list
robust-ctl mqtt user listuser list result:
+----------+--------------+
| username | is_superuser |
+==========+==============+
| <run-id>-user | false |
+----------+--------------+
| admin | true |
+----------+--------------+robust-ctl mqtt user create
robust-ctl mqtt user create --username <run-id>-user --password <run-id>-passwordCreated successfully!robust-ctl mqtt user delete
robust-ctl mqtt user delete --username <run-id>-userDeleted successfully!3.3 ACL management
robust-ctl mqtt acl list
robust-ctl mqtt acl listacl list result:
+------+------+---------------+---------------+-------+----+--------+------------+
| name | desc | resource_type | resource_name | topic | ip | action | permission |
+======+======+===============+===============+=======+====+========+============+
| <run-id>-acl | | ClientId | <run-id>-client | <run-id>/messages | | All | Allow |
+------+------+---------------+---------------+-------+----+--------+------------+robust-ctl mqtt acl create
robust-ctl mqtt acl create --tenant default --name <run-id>-acl --resource-type ClientId --resource-name <run-id>-client --topic "<run-id>/messages" --action All --permission AllowCreated successfully!robust-ctl mqtt acl delete
robust-ctl mqtt acl delete --tenant default --name <run-id>-aclDeleted successfully!3.4 Blacklist management
robust-ctl mqtt blacklist list
robust-ctl mqtt blacklist listblacklist list result:
+------+----------------+---------------+----------+-------------+
| name | blacklist_type | resource_name | end_time | description |
+======+================+===============+==========+=============+
| <run-id>-blacklist | ClientId | <run-id>-client | <timestamp> | <run-id> blacklist |
+------+----------------+---------------+----------+-------------+robust-ctl mqtt blacklist create
robust-ctl mqtt blacklist create --tenant default --name <run-id>-blacklist --blacklist-type ClientId --resource-name <run-id>-client --end-time <unix-time> --desc "<run-id> blacklist"Created successfully!robust-ctl mqtt blacklist delete
robust-ctl mqtt blacklist delete --tenant default --name <run-id>-blacklistDeleted successfully!3.5 Topic Rewrite
robust-ctl mqtt topic-rewrite list
robust-ctl mqtt topic-rewrite listtopic rewrite rule list result:
+------+------+--------+--------+--------------+------------+-------+
| name | desc | tenant | action | source_topic | dest_topic | regex |
+======+======+========+========+==============+============+=======+
| <run-id>-rewrite | <run-id> rewrite | default | All | <run-id>/source | <run-id>/destination | ^.*$ |
+------+------+--------+--------+--------------+------------+-------+robust-ctl mqtt topic-rewrite create
robust-ctl mqtt topic-rewrite create --tenant default --name <run-id>-rewrite --action All --source-topic "<run-id>/source" --dest-topic "<run-id>/destination" --regex '^.*$'Created successfully!robust-ctl mqtt topic-rewrite delete
robust-ctl mqtt topic-rewrite delete --tenant default --name <run-id>-rewriteDeleted successfully!3.6 Connector
connector list requires --connector-name in the current CLI. The integration test uses the local-file connector so it does not need Kafka.
robust-ctl mqtt connector list
robust-ctl mqtt connector list --connector-name <run-id>-connectorconnector list result:
+----------------+----------------+------------------+----------+--------+-----------+-------------+-------------+
| connector name | connector type | connector config | topic id | status | broker id | create time | update time |
+================+================+==================+==========+========+===========+=============+============+
| <run-id>-connector | file | {"LocalFile":...} | <run-id>/messages | Running | 1 | <timestamp> | <timestamp> |
+----------------+----------------+------------------+----------+--------+-----------+-------------+-------------+robust-ctl mqtt connector create
robust-ctl mqtt connector create --tenant default --connector-name <run-id>-connector --connector-type file --config '{"local_file_path":"<temp-file>","rotation_strategy":"none"}' --topic-name <run-id>/messagesCreated successfully!robust-ctl mqtt connector delete
robust-ctl mqtt connector delete --tenant default --connector-name <run-id>-connectorDeleted successfully!3.7 Schema
schema list accepts --schema-name, and schema list-bind requires the same --tenant used by schema bind.
For the control-plane, broker-cache, and publish-validation flow, see the Schema Registry Architecture.
robust-ctl mqtt schema list
robust-ctl mqtt schema list --schema-name <run-id>-schemaschema list result:
schema name: <run-id>-schema
schema type: json
schema desc: <run-id> schema
schema: {"type":"object","properties":{"value":{"type":"string"}}}robust-ctl mqtt schema create
robust-ctl mqtt schema create --tenant default --schema-name <run-id>-schema --schema-type json --schema '{"type":"object","properties":{"value":{"type":"string"}}}' --desc "<run-id> schema"Created successfully!robust-ctl mqtt schema delete
robust-ctl mqtt schema delete --tenant default --schema-name <run-id>-schemaDeleted successfully!robust-ctl mqtt schema list-bind
robust-ctl mqtt schema list-bind --tenant default --schema-name <run-id>-schema --resource-name <run-id>/schema-topicbind schema list result:
data type: resource
- <run-id>-schema
data type: schema
- <run-id>/schema-topicrobust-ctl mqtt schema bind
robust-ctl mqtt schema bind --tenant default --schema-name <run-id>-schema --resource-name <run-id>/schema-topicCreated successfully!robust-ctl mqtt schema unbind
robust-ctl mqtt schema unbind --tenant default --schema-name <run-id>-schema --resource-name <run-id>/schema-topicDeleted successfully!3.8 Auto Subscribe
robust-ctl mqtt auto-subscribe list
robust-ctl mqtt auto-subscribe listauto subscribe rule list result:
+------+------+--------+-------+-----+----------+---------------------+-------------------+
| name | desc | tenant | topic | qos | no_local | retain_as_published | retained_handling |
+======+======+========+=======+=====+==========+=====================+===================+
| <run-id>-auto | | default | <run-id>/messages | AtLeastOnce | false | false | OnEverySubscribe |
+------+------+--------+-------+-----+----------+---------------------+-------------------+robust-ctl mqtt auto-subscribe create
robust-ctl mqtt auto-subscribe create --tenant default --name <run-id>-auto --topic "<run-id>/messages" --qos 1Created successfully!robust-ctl mqtt auto-subscribe delete
robust-ctl mqtt auto-subscribe delete --tenant default --name <run-id>-autoDeleted successfully!3.9 Observability
robust-ctl mqtt flapping-detect
robust-ctl mqtt flapping-detectflapping detect list result:
+-----------+---------------------------------+--------------------+
| client_id | before_last_windows_connections | first_request_time |
+===========+=================================+====================+
+-----------+---------------------------------+--------------------+robust-ctl mqtt slow-subscribe list
robust-ctl mqtt slow-subscribe listslow subscribe list result:
+-----------+------------+----------------+-----------+-------------+
| client_id | topic_name | subscribe_name | time_span | create_time |
+===========+============+================+===========+============+
+-----------+------------+----------------+-----------+-------------+robust-ctl mqtt system-alarm list
robust-ctl mqtt system-alarm listExample output after a memory alarm has been persisted:
system alarm list result:
+---------+-------------+-----------------+------------------------------------------------+-------------+-----------+
| node_id | node_ip | name | message | create_time | activated |
+=========+=============+=================+================================================+=============+===========+
| 1 | 127.0.0.1 | HighMemoryUsage | HighMemoryUsage is 85.2%, but config is 80% | 1749774914 | true |
+---------+-------------+-----------------+------------------------------------------------+-------------+-----------+3.10 MQTT publish and subscribe
robust-ctl mqtt publish
robust-ctl mqtt publish --mqtt-server <mqtt-addr> --username admin --password robustmq --topic "<run-id>/messages" --qos 1able to connect: "<mqtt-addr>"
you can post a message on the terminal:
> You typed: <payload>
> End of input stream.With --retained, the command confirms retained delivery:
published retained messagerobust-ctl mqtt subscribe
robust-ctl mqtt subscribe --mqtt-server <mqtt-addr> --username admin --password robustmq --topic "<run-id>/messages" --qos 1able to connect: "<mqtt-addr>"
subscribe success
payload: <retained-payload>
payload: <message-one-payload>
payload: <message-two-payload>
payload: <qos2-payload>
Ctrl+C detected, Please press ENTER to end the program.
End of input stream.Output
- default:
table - machine-readable:
--output json - publish/subscribe use
--mqtt-server(default: configured MQTT TCP port, then127.0.0.1:1883);--serverremains the Admin API endpoint.
Mutation, Interactive, and Error Output
The basic list commands above show each command immediately followed by its verified output. This section records the output contracts for mutations, interactive MQTT commands, and expected failures. Replace angle-bracket values with the current run's generated names and ports.
Successful mutations return exit status 0 and a confirmation on stdout:
$ robust-ctl mqtt user create --username <run-user> --password <run-password>
Created successfully!Table-mode lists are human-readable:
user list result:
+----------+--------------+
| username | is_superuser |
+==========+==============+
| admin | true |
+----------+--------------+JSON-mode lists contain data and total_count and are emitted as clean JSON on stdout:
{
"data": [
{
"tenant": "default",
"username": "admin",
"is_superuser": true,
"create_time": 1792462675
}
],
"total_count": 1
}Schema binding results are grouped by data_type and require the same tenant for bind and list operations:
{
"data": [
{ "data_type": "resource", "data": ["<run-id>-schema"] },
{ "data_type": "schema", "data": ["<run-id>/schema-topic"] }
],
"total_count": 2
}Interactive MQTT output is line-oriented and a successful flow emits each payload once before clean Ctrl-C termination:
able to connect: "127.0.0.1:<mqtt-port>"
subscribe success
payload: retained-<run-id>
payload: message-one-<run-id>
payload: message-two-<run-id>
payload: qos2-<run-id>
Ctrl+C detected, Please press ENTER to end the program.
End of input stream.Expected failures return non-zero status and retain diagnostics on stderr:
# invalid QoS: exit status 1
Exception:Server returned error: code=400, message=... QoS must be 0, 1 or 2
# unavailable Admin API: exit status 1
Exception:Request failed: error sending request for url (http://127.0.0.1:1/api/mqtt/overview)The banner is diagnostic output and does not belong to JSON stdout. Use jq on stdout only when --output json is selected.
A complete integration run ends with exit status 0:
$ ./scripts/test/cli/mqtt/run.sh
[mqtt] retained delivery, QoS 1/2 publish, exact-once messages, and Ctrl-C passed
All MQTT CLI integration checks passed.The verified populated run executed 72 CLI invocations covering table/JSON reads, stateful resources, MQTT publish/subscribe, and endpoint/error checks. Duplicate creation, invalid QoS, unavailable Admin API, and invalid MQTT credentials are expected non-zero cases and are asserted explicitly.
