Skip to content

Commit c79b43c

Browse files
committed
Update README.md to describe new parameters
1 parent 1cbe481 commit c79b43c

File tree

1 file changed

+71
-6
lines changed

1 file changed

+71
-6
lines changed

README.md

+71-6
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,12 @@ below:
8484
> INSERT INTO mqtt_sink FROM processed;
8585
```
8686

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.
8993

9094
## Reference
9195

@@ -97,6 +101,8 @@ parameters.
97101
* `broker`
98102
* `user`
99103
* `password`
104+
* `reconnect_min_time`
105+
* `reconnect_max_time`
100106

101107
#### `topic`
102108

@@ -106,8 +112,11 @@ wildcards. `topic` is a required parameter.
106112
#### `broker`
107113

108114
`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.
111120

112121
#### `user`
113122

@@ -119,6 +128,36 @@ an empty string.
119128
`password` is the password of the user specified by the `user` parameter.
120129
The default value is an empty string.
121130

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+
122161
### Sink
123162

124163
The MQTT sink has following optional parameters.
@@ -128,13 +167,18 @@ The MQTT sink has following optional parameters.
128167
* `password`
129168
* `topic_field`
130169
* `payload_field`
170+
* `qos_field`
131171
* `default_topic`
172+
* `default_qos`
132173

133174
#### `broker`
134175

135176
`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.
138182

139183
#### `user`
140184

@@ -176,8 +220,29 @@ like below:
176220

177221
Note that both `topic_field` and `payload_field` can be specified at once.
178222

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+
179239
#### `default_topic`
180240

181241
`default_topic` is used when a tuple doesn't have a topic field. Its value
182242
must not be empty. When this parameter is not specified, a tuple missing the
183243
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

Comments
 (0)