2025-05-29 18:59:39 +00:00
|
|
|
#
|
2025-05-21 13:53:46 +00:00
|
|
|
|
2025-05-29 18:59:39 +00:00
|
|
|
::: mkdocs-typer2
|
|
|
|
:module: amqtt.scripts.sub_script
|
|
|
|
:name: amqtt_pub
|
|
|
|
:pretty: true
|
2025-05-21 13:53:46 +00:00
|
|
|
|
2025-05-28 12:39:02 +00:00
|
|
|
## Default Configuration
|
2025-05-21 13:53:46 +00:00
|
|
|
|
2025-05-29 18:59:39 +00:00
|
|
|
Without the `-c` argument, the client will run with the following, default configuration:
|
2025-05-21 13:53:46 +00:00
|
|
|
|
2025-05-28 12:39:02 +00:00
|
|
|
```yaml
|
2025-06-09 18:32:55 +00:00
|
|
|
--8<-- "amqtt/scripts/default_client.yaml"
|
2025-05-28 12:39:02 +00:00
|
|
|
```
|
2025-05-21 13:53:46 +00:00
|
|
|
|
2025-05-28 12:39:02 +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
|
|
|
|
2025-05-28 12:39:02 +00:00
|
|
|
|
|
|
|
## Examples
|
2015-11-06 21:47:12 +00:00
|
|
|
|
2017-01-09 21:26:36 +00:00
|
|
|
Subscribe with QoS 0 to all messages published under $SYS/:
|
2025-05-22 01:59:12 +00:00
|
|
|
|
2025-05-21 13:53:46 +00:00
|
|
|
```bash
|
|
|
|
amqtt_sub --url mqtt://localhost -t '$SYS/#' -q 0
|
|
|
|
```
|
2015-11-06 21:47:12 +00:00
|
|
|
|
|
|
|
Subscribe to 10 messages with QoS 2 from /#:
|
2025-05-22 01:59:12 +00:00
|
|
|
|
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-22 01:59:12 +00:00
|
|
|
|
2025-05-21 13:53:46 +00:00
|
|
|
```bash
|
|
|
|
amqtt_sub --url wss://localhost -t '$SYS/#' -q 0 --extra-headers '{"Authorization": "Bearer <token>"}'
|
|
|
|
```
|