Skip to content

Commit 5cea33f

Browse files
authored
docs: add mqtt source multi topic doc (#3835)
Signed-off-by: Song Gao <disxiaofei@163.com>
1 parent b1502da commit 5cea33f

File tree

2 files changed

+16
-0
lines changed
  • docs

2 files changed

+16
-0
lines changed

docs/en_US/guide/sources/builtin/mqtt.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,3 +194,11 @@ Starting from version 1.5.0, eKuiper has modified the MQTT source broker configu
194194

195195
- If you've been using an MQTT broker as a stream source in earlier versions and plan to upgrade to 1.5.0 or subsequent releases, ensure that the `server` configuration in the `etc/mqtt_source.yaml` file is correctly set.
196196
- If you've been relying on environment variables to determine the MQTT source address, an adjustment is required. For instance, if your broker address is `tcp://broker.emqx.io:1883`, then the environment variable should be changed from `MQTT_SOURCE__DEFAULT__SERVERS=[tcp://broker.emqx.io:1883]` to `MQTT_SOURCE__DEFAULT__SERVER="tcp://broker.emqx.io:1883"`
197+
198+
## Listening to Multiple Topics
199+
200+
When creating a stream, we can use the following method to listen to multiple topics simultaneously:
201+
202+
```sql
203+
{"sql":"create stream my_stream (id bigint, name string, score float) WITH ( datasource = \"t1,t2\", FORMAT = \"json\", KEY = \"id\")"}
204+
```

docs/zh_CN/guide/sources/builtin/mqtt.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,3 +187,11 @@ REST API 为 eKuiper 提供了一种可编程的交互方式,适用于自动
187187

188188
- 如希望通过配置文件配置,请确保 `etc/mqtt_source.yaml` 文件内的 `server` 已正确配置。
189189
- 如希望通过环境变量配置,例如针对 `tcp://broker.emqx.io:1883` 地址,配置命令应从 `MQTT_SOURCE__DEFAULT__SERVERS=[tcp://broker.emqx.io:1883]` 改为 `MQTT_SOURCE__DEFAULT__SERVER="tcp://broker.emqx.io:1883"`。
190+
191+
## 监听多个 topic
192+
193+
在创建流信息时,我们可以通过以下方式同时监听多个 topic:
194+
195+
```sql
196+
{"sql":"create stream my_stream (id bigint, name string, score float) WITH ( datasource = \"t1,t2\", FORMAT = \"json\", KEY = \"id\")"}
197+
```

0 commit comments

Comments
 (0)