amqtt/docs/references/amqtt_sub.md

38 wiersze
892 B
Markdown

#
2025-05-21 13:53:46 +00:00
::: mkdocs-typer2
:module: amqtt.scripts.sub_script
:name: amqtt_pub
:pretty: true
2025-05-21 13:53:46 +00:00
## Default Configuration
2025-05-21 13:53:46 +00:00
Without the `-c` argument, the client will run with the following, default configuration:
2025-05-21 13:53:46 +00:00
```yaml
--8<-- "amqtt/scripts/default_client.yaml"
```
2025-05-21 13:53:46 +00:00
Using the `-c` argument allows for configuration with a YAML structured file; see [client configuration](client_config.md).
2025-05-21 13:53:46 +00:00
## Examples
2017-01-09 21:26:36 +00:00
Subscribe with QoS 0 to all messages published under $SYS/:
2025-05-21 13:53:46 +00:00
```bash
amqtt_sub --url mqtt://localhost -t '$SYS/#' -q 0
```
Subscribe to 10 messages with QoS 2 from /#:
2025-05-21 13:53:46 +00:00
```bash
amqtt_sub --url mqtt://localhost -t # -q 2 -n 10
```
Subscribe with QoS 0 to all messages published under $SYS/ over mqtt encapsulated in a websocket connection and additional headers:
2025-05-21 13:53:46 +00:00
```bash
amqtt_sub --url wss://localhost -t '$SYS/#' -q 0 --extra-headers '{"Authorization": "Bearer <token>"}'
```