Skip to content

add cli message-properties and $SYS control flags - #122

Merged
fabracht merged 2 commits into
mainfrom
cli-message-properties-and-sys-flags
Jul 26, 2026
Merged

add cli message-properties and $SYS control flags#122
fabracht merged 2 commits into
mainfrom
cli-message-properties-and-sys-flags

Conversation

@fabracht

Copy link
Copy Markdown
Contributor

Adds the three CLI options requested in #115.

mqttv5 sub --show-properties (-s)

Prints the MQTT v5 properties of each received message alongside its payload. When set, the subscriber renders the delivered QoS, the retain flag, and every present property (payload format indicator, message expiry interval, content type, response topic, correlation data as hex, subscription identifiers, and user properties), one per line, followed by the payload. Without the flag the output is unchanged (payload only, or topic: payload under --verbose).

topic: sensors/temp
  qos: 1
  message-expiry-interval: 3600
  content-type: application/json
  user-property: x-mqtt-client-id=sensor-01
  payload: 21.4

mqttv5 broker --no-sys-topics and --sys-interval <DUR>

Expose the broker's $SYS statistics publishing on the command line. --no-sys-topics disables $SYS publishing (enabled by default); --sys-interval sets the publish interval and accepts a bare number of seconds or a duration such as 10s or 1m (default 10). Both map to the existing BrokerConfig fields, so an interval of zero while $SYS is enabled is still rejected at config validation.

Notes

  • mqttv5-cli bumped 0.28.4 -> 0.28.5 (additive), CHANGELOG updated
  • Docs updated (README.md, CLI_USAGE.md); also removed a stale sub -t a -t b "multiple topics" example that the command rejects
  • Tests added to cli_functionality.rs: test_cli_sub_show_properties (real pub -> sub asserting rendered properties) and test_cli_broker_sys_flags (help exposes the flags)

Closes #115

@fabracht
fabracht merged commit 5d7b154 into main Jul 26, 2026
16 checks passed
@fabracht
fabracht deleted the cli-message-properties-and-sys-flags branch July 26, 2026 20:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE] New additional CLI options

1 participant