@@ -84,8 +84,12 @@ below:
84
84
> INSERT INTO mqtt_sink FROM processed;
85
85
```
86
86
87
- The name of ` topic ` and ` payload ` fields can be changed by setting ` topic_field `
88
- and ` payload_field ` parameters described later.
87
+ A tuple inserted into the sink can have the ` qos ` field. Its value must be 0, 1,
88
+ or 2 as an integer. Those numbers correspond to at most once, at least once,
89
+ and exactly once, respectively.
90
+
91
+ The names of ` topic ` , ` payload ` , and ` qos ` fields can be changed by setting
92
+ ` topic_field ` , ` payload_field ` , and ` qos_field ` parameters described later.
89
93
90
94
## Reference
91
95
@@ -97,6 +101,8 @@ parameters.
97
101
* ` broker `
98
102
* ` user `
99
103
* ` password `
104
+ * ` reconnect_min_time `
105
+ * ` reconnect_max_time `
100
106
101
107
#### ` topic `
102
108
@@ -106,8 +112,11 @@ wildcards. `topic` is a required parameter.
106
112
#### ` broker `
107
113
108
114
` broker ` is the address of the MQTT broker from which the source subscribes.
109
- The address should be in ` "host:port" ` format. The default value is
110
- ` 127.0.0.1:1883 ` .
115
+ The address should be in ` "scheme://host:port" ` format. The default value is
116
+ ` tcp://127.0.0.1:1883 ` .
117
+
118
+ The old ` "host:port" ` format is still supported in the latest version, but the
119
+ support will be dropped in the next major version up.
111
120
112
121
#### ` user `
113
122
@@ -119,6 +128,36 @@ an empty string.
119
128
` password ` is the password of the user specified by the ` user ` parameter.
120
129
The default value is an empty string.
121
130
131
+ #### ` reconnect_min_time `
132
+
133
+ ` reconnect_min_time ` is the minimal time to wait before reconnecting to the
134
+ broker. The value can be specified in second as an integer or a float. It can
135
+ also be a string having Go duration format like ` "1s" ` . The default value is 1
136
+ second.
137
+
138
+ Examples:
139
+
140
+ ```
141
+ reconnect_min_time = 5
142
+ reconnect_min_time = 1.5
143
+ reconnect_min_time = "3s"
144
+ ```
145
+
146
+ #### ` reconnect_max_time `
147
+
148
+ ` reconnect_max_time ` is the maximum time to wait before reconnecting to the
149
+ broker. The value can be specified in second as an integer or a float. It can
150
+ also be a string having Go duration format like ` "1s" ` . The default value is 30
151
+ second.
152
+
153
+ Examples:
154
+
155
+ ```
156
+ reconnect_max_time = 40
157
+ reconnect_max_time = 60.5
158
+ reconnect_max_time = "1m"
159
+ ```
160
+
122
161
### Sink
123
162
124
163
The MQTT sink has following optional parameters.
@@ -128,13 +167,18 @@ The MQTT sink has following optional parameters.
128
167
* ` password `
129
168
* ` topic_field `
130
169
* ` payload_field `
170
+ * ` qos_field `
131
171
* ` default_topic `
172
+ * ` default_qos `
132
173
133
174
#### ` broker `
134
175
135
176
` broker ` is the address of the MQTT broker to which the sink publishes messages.
136
- The address should be in ` "host:port" ` format. The default value is
137
- ` 127.0.0.1:1883 ` .
177
+ The address should be in ` "scheme://host:port" ` format. The default value is
178
+ ` tcp://127.0.0.1:1883 ` .
179
+
180
+ The old ` "host:port" ` format is still supported in the latest version, but the
181
+ support will be dropped in the next major version up.
138
182
139
183
#### ` user `
140
184
@@ -176,8 +220,29 @@ like below:
176
220
177
221
Note that both ` topic_field ` and ` payload_field ` can be specified at once.
178
222
223
+ #### ` qos_field `
224
+
225
+ ` qos_field ` is the name of the field containing a qos as an integer. For
226
+ example, when ` qos_field = "my_qos" ` , a tuple inserted into the sink should
227
+ look like below:
228
+
229
+ ```
230
+ {
231
+ "my_qos": 2,
232
+ "topic": "some/topic",
233
+ "payload": ... payload data ...
234
+ }
235
+ ```
236
+
237
+ The default value is ` qos ` .
238
+
179
239
#### ` default_topic `
180
240
181
241
` default_topic ` is used when a tuple doesn't have a topic field. Its value
182
242
must not be empty. When this parameter is not specified, a tuple missing the
183
243
topic field will result in an error and will not be published.
244
+
245
+ #### ` default_qos `
246
+
247
+ ` default_qos ` is used when a tuple doesn't have a qos field. Its value must be
248
+ 0 (at most once), 1 (at least once), or 2 (exactly once). The default value is 0.
0 commit comments