mirror of
https://github.com/tldr-pages/tldr.git
synced 2025-07-01 09:15:22 +02:00
mosquitto_sub: add page (#2718)
This commit is contained in:
parent
4f6598f0b8
commit
fb99709211
1 changed files with 15 additions and 0 deletions
15
pages/common/mosquitto_sub.md
Normal file
15
pages/common/mosquitto_sub.md
Normal file
|
@ -0,0 +1,15 @@
|
|||
# mosquitto_sub
|
||||
|
||||
> A simple MQTT version 3.1.1 client that will subscribe to topics and print the messages that it receives.
|
||||
|
||||
- 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/+}}`
|
Loading…
Add table
Reference in a new issue