Skip to content

Commit 26ba35e

Browse files
committed
docs: use sse instead of websocket for ruletest
Signed-off-by: Jiyong Huang <huangjy@emqx.io>
1 parent d99dedf commit 26ba35e

File tree

2 files changed

+16
-16
lines changed

2 files changed

+16
-16
lines changed

docs/en_US/api/restapi/ruletest.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,16 @@ and it will automatically stop and clear after the time is exceeded. The general
1010
follows:
1111

1212
1. [Create a test rule](#create-a-test-rule), get the id and port of the test rule.
13-
2. Use the id and port of the test rule to connect and listen to the WebSocket service. Its service address
13+
3. Use the id and port of the test rule to connect and listen to the SSE service. Its service address
1414
is `http://locahost:10081/test/myid` where `10081` is the port value returned in step 1, and myid is the id of the
15-
test rule.
15+
test rule. Server-Sent Events (SSE) allows the server to push updates to the client. Connect via HTTP GET with header `Accept: text/event-stream`.
1616
3. [Start the test rule](#start-the-test-rule), wait for the test rule to run. The rule running result will be returned
17-
through the WebSocket service.
18-
4. After the rule trial run ends, [delete the test rule](#delete-the-test-rule), and close the WebSocket service.
17+
through the SSE service.
18+
4. After the rule trial run ends, [delete the test rule](#delete-the-test-rule), and close the SSE service.
1919

2020
::: tip
2121

22-
The WebSocket service defaults to port 10081, which can be modified by the `httpServerPort` field in the `kuiper.yaml`
22+
The SSE service defaults to port 10081, which can be modified by the `httpServerPort` field in the `kuiper.yaml`
2323
configuration file. Before using the test rule, please make sure that this port is accessible.
2424

2525
:::
@@ -93,7 +93,7 @@ If created successfully, the return example is as follows:
9393
}
9494
```
9595

96-
After the rule is created successfully, the websocket endpoint starts. Users can listen to the websocket
96+
After the rule is created successfully, the SSE endpoint starts. Users can listen to the SSE
9797
address `http://locahost:10081/test/uuid` to get the result output. Among them, the port and id are the above return
9898
values.
9999

@@ -111,12 +111,12 @@ If creation fails, the status code is 400, return error information, an example
111111
POST /ruletest/{id}/start
112112
```
113113

114-
Start the trial run rule, WebSocket will be able to receive the data output after the rule runs.
114+
Start the trial run rule, SSE will be able to receive the data output after the rule runs.
115115

116116
## Delete the Test Rule
117117

118118
```shell
119119
DELETE /ruletest/{id}
120120
```
121121

122-
Delete the trial run rule, WebSocket will stop the service.
122+
Delete the trial run rule, SSE will stop the service.

docs/zh_CN/api/restapi/ruletest.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@
77
10 分钟),超过时间后会自动停止并清除。使用规则试运行的一般步骤如下:
88

99
1. [创建测试规则](#创建测试规则),获得测试规则的 id 和端口。
10-
2. 使用测试规则的 id 和端口,连接并监听 WebSocket 服务。其服务地址为 `http://locahost:10081/test/myid` 其中 `10081` 为步骤1
11-
返回的端口值,myid 为测试规则的 id。
12-
3. [启动测试规则](#启动测试规则),等待测试规则运行。规则运行结果将通过 WebSocket 服务返回。
13-
4. 规则试运行结束后,[删除测试规则](#删除测试规则),关闭 WebSocket 服务。
10+
2. 使用测试规则的 id 和端口,连接并监听 SSE 服务。其服务地址为 `http://locahost:10081/test/myid` 其中 `10081` 为步骤1
11+
返回的端口值,myid 为测试规则的 id。Server-Sent Events (SSE) 允许服务器向客户端推送更新。请使用带有请求头 `Accept: text/event-stream` 的 HTTP GET 请求进行连接。
12+
3. [启动测试规则](#启动测试规则),等待测试规则运行。规则运行结果将通过 SSE 服务返回。
13+
4. 规则试运行结束后,[删除测试规则](#删除测试规则),关闭 SSE 服务。
1414

1515
::: tip
1616

17-
WebSocket 服务默认采用 10081 端口,可通过配置文件 `kuiper.yaml` 中的 `httpServerPort` 字段修改。使用测试规则前,请确保该端口可访问。
17+
SSE 服务默认采用 10081 端口,可通过配置文件 `kuiper.yaml` 中的 `httpServerPort` 字段修改。使用测试规则前,请确保该端口可访问。
1818

1919
:::
2020

@@ -84,7 +84,7 @@ POST /ruletest
8484
}
8585
```
8686

87-
规则创建成功后,websocket endpoint 启动。用户可通过监听 websocket 地址 `http://locahost:10081/test/uuid` 获取结果输出。其中,端口和
87+
规则创建成功后,SSE endpoint 启动。用户可通过监听 SSE 地址 `http://locahost:10081/test/uuid` 获取结果输出。其中,端口和
8888
id 为上述返回值。
8989

9090
若创建失败,状态码为 400,返回错误信息,示例如下:
@@ -101,12 +101,12 @@ id 为上述返回值。
101101
POST /ruletest/{id}/start
102102
```
103103

104-
启动试运行规则,WebSocket 将可接收到规则运行后输出的数据。
104+
启动试运行规则,SSE 将可接收到规则运行后输出的数据。
105105

106106
## 删除测试规则
107107

108108
```shell
109109
DELETE /ruletest/{id}
110110
```
111111

112-
删除试运行规则,WebSocket 将停止服务。
112+
删除试运行规则,SSE 将停止服务。

0 commit comments

Comments
 (0)