File: client_config.md

package info (click to toggle)
amqtt 0.11.3-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,660 kB
  • sloc: python: 14,565; sh: 42; makefile: 34; javascript: 27
file content (80 lines) | stat: -rw-r--r-- 1,643 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
# Client Configuration

This configuration structure is either a `amqtt.contexts.ClientConfig` or a python dictionary with identical structure
when instantiating `amqtt.broker.MQTTClient` or as a yaml formatted file passed to the `amqtt_pub` script.

If not specified, the `MQTTClient()` will be started with the default `ClientConfig()`, as represented in yaml format:

```yaml
---
keep_alive: 10
ping_delay: 1
default_qos: 0
default_retain: false
auto_reconnect: true
connection_timeout: 60
reconnect_retries: 2
reconnect_max_interval: 10
cleansession: true
broker:
  uri: "mqtt://127.0.0.1"
plugins:
  amqtt.plugins.logging_amqtt.PacketLoggerPlugin:
```

::: amqtt.contexts.ClientConfig
    options:
      heading_level: 3
      extra:
        class_style: "simple"

::: amqtt.contexts.TopicConfig
    options:
      heading_level: 3
      extra:
        class_style: "simple"

::: amqtt.contexts.WillConfig
    options:
      heading_level: 3
      extra:
        class_style: "simple"

::: amqtt.contexts.ConnectionConfig
    options:
      heading_level: 3
      extra:
        class_style: "simple"



## Example

A more expansive `ClientConfig` in equivalent yaml format:

```yaml

keep_alive: 10
ping_delay: 1
default_qos: 0
default_retain: false
auto_reconnect: true
reconnect_max_interval: 5
reconnect_retries: 10
topics:
   topic/subtopic:
    qos: 0
   topic/other:
     qos: 2
     retain: true
will:
   topic: will/messages
   message: "client ABC has disconnected"
   qos: 1
   retain: false
broker:
   uri: 'mqtt://localhost:1883'
   cafile: '/path/to/ca/file'
plugins:
  - amqtt.plugins.logging_amqtt.PacketLoggerPlugin:
```