Credits:The XMQ web site is provided by Linotex.The XMQ and SPTK Windows installers are created with Advanced Installer free Open-Source license.
There were 0 unique visitors to this page

xmq_sub

The xmq_sub utility is a command-line client for MQTT version 5/3.1.1/3.1 used for subscribing to topics and receiving messages.

Usage

xmq_sub [options]

Examples

# Subscribe to a topic and print each received message:
xmq_sub -h broker.example.com -t sensors/temperature -v

# Subscribe to two topics at QoS 1, stop after 50 messages:
xmq_sub -h broker.example.com -t "sensors/temperature;sensors/humidity" -q 1 -C 50

# Subscribe and stop after 30 seconds of waiting:
xmq_sub -h broker.example.com -t status -W 30

Options

  • -W, --disconnect-after: Disconnect after waiting for messages for N seconds. (Default: 0)
  • -C, --receive-count: Disconnect and exit after receiving the 'msg_count' messages. (Default: 0)
  • -x, --session-expiry-interval: Session expiry interval, the default is no expire.
  • -q, --qos: Message QOS: 2. (Default: 0)
  • -t, --topic: Message topic. Multiple topics can be separated by semicolon. The topic may include %ClientIndex% that is substituted by the client index (number).
  • --quiet: Don't print to stdout.
  • -d, --debug: Print debug messages.
  • --help: Print this help.
  • -c, --disable-clean-session: Disable clean session.
  • -v, --print-messages: Print received messages.