1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2025-04-29 23:24:55 +02:00
tldr/pages/common/mosquitto_sub.md
Lucas Gabriel Schneider a5fe31bc47
multiple pages: format technical tokens (#5119)
Co-authored-by: bl-ue <54780737+bl-ue@users.noreply.github.com>
Co-authored-by: Starbeamrainbowlabs <sbrl@starbeamrainbowlabs.com>
2021-01-31 12:05:18 -05:00

16 lines
734 B
Markdown

# mosquitto_sub
> A simple MQTT version 3.1.1 client that will subscribe to topics and print the messages that it receives.
> More information: <https://mosquitto.org/man/mosquitto_sub-1.html>.
- Subscribe to the topic `sensors/temperature` information with Quality of Service (`QoS`) set to 1. (The default hostname is `localhost` and port 1883):
`mosquitto_sub -t {{sensors/temperature}} -q {{1}}`
- Subscribe to all broker status messages publishing on `iot.eclipse.org` port 1885 and print published messages verbosely:
`mosquitto_sub -v -h "iot.eclipse.org" -p 1885 -t {{\$SYS/#}}`
- Subscribe to multiple topics matching a given pattern. (+ takes any metric name):
`mosquitto_sub -t {{sensors/machines/+/temperature/+}}`