Skip to content

Commit e2ed188

Browse files
authored
Merge pull request #2661 from emqx/Enhance-rule-and-integration
feat(rules): Update View Rules and View Connector
2 parents 20b3804 + eb9e89a commit e2ed188

16 files changed

+75
-20
lines changed

en_US/changes/changes-ce-v5.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Version 5
1+
# EMQX Open Source Version 5
22

33
## 5.8.0
44

en_US/changes/changes-ee-v5.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Version 5
1+
# EMQX Enterprise Version 5
22

33
## 5.8.0
44

Loading
92.1 KB
Loading
177 KB
Loading
Loading

en_US/data-integration/connector.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,9 @@ After a connector is created, you can view its basic information on the Connecto
5454

5555
If the connector is used by a Sink/Source, updating the connector configuration will cause the Sink/Source to reload, which may cause data processing interruptions. It is recommended to update during off-peak business hours.
5656

57-
A connector that is in use cannot be deleted. To delete a connector, first delete the Sink/Source using the connector.
57+
A connector that is in use cannot be deleted. To delete a connector, first delete the Sink/Source using the connector. When you delete a connector, a warning dialog will pop up displaying the Sink/Source associated with the connector. Clicking the Sink/Source will bring you to the rule settings page where you can delete the Sink/Source.
58+
59+
![delete_associated_sink](./assets/delete_associated_sink.png)
5860

5961
## Connector Status
6062

en_US/data-integration/rule-get-started.md

+33-10
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,27 @@
11
# Create Rules
22

3-
This page mainly introduces how to create a rule for data processing and attach an action to the rule using the EMQX Dashboard. Log in to the EMQX Dashboard and click **Integration** -> **Rules** in the left navigation menu. Then click the **Create** button, which directs you to the **Rules** page. Here, you can define the data source for your rule and determine the subsequent actions for the filtered messages.
3+
This page provides guidance on how to create rules for data processing and attach an action to a rule using the EMQX Dashboard. It also introduces how to test rules and view rules after the rule creation.
44

55
The demonstration on this page takes the republish action as an example, describing how to create a rule that processes messages received on the topic `t/#` and republishes the message to the topic `a/1`. However, the actions "printing the result to the Console" and "forwarding with Sinks" are also mentioned in [Add Action](#add-action).
66

77
## Define a Data Source
8-
On the **Rules** page, enter a name for your rule and add a note to facilitate future management.
8+
Log in to the EMQX Dashboard and click **Integration** -> **Rules** in the left navigation menu.
99

10-
In the **SQL Editor**, you can customize the statements to add a data source that suits your business needs. For this tutorial, keep the default setting, which selects and returns all messages under topics that follow the `"t/#"` pattern (e.g., `t/a`, `t/a/b`, `t/a/b/c`, etc.).
10+
Click the **Create** button on the **Rule** page and you will be directed to the **Create Rule** page. Here, you can define the data source for your rule and determine the subsequent actions for the filtered messages.
11+
12+
Enter a name for your rule and add a note to facilitate future management. In the **SQL Editor**, you can customize the statements to add a data source that suits your business needs. For this tutorial, keep the default setting, which selects and returns all messages under topics that follow the `"t/#"` pattern (e.g., `t/a`, `t/a/b`, `t/a/b/c`, etc.).
1113

1214
::: tip
1315

14-
This tutorial assumes the payload is JSON. If the payload is formatted in some other way, you can convert the data type, for example, with the [Schema Registry](./schema-registry.md).
16+
This tutorial assumes the message payload is JSON. If the payload is formatted in some other way, you can convert the data type, for example, with the [Schema Registry](./schema-registry.md).
1517

1618
EMQX has embedded rich SQL statement samples to help you get started, you can click the **SQL Example** button under the **SQL Editor** to explore. For more details about the SQL syntax and usages, see [SQL Syntax](./rule-sql-syntax.md).
1719

1820
:::
1921

2022
<img src="./assets/rules/create-rules.png" alt="image-20230417211146211" style="zoom:40%;" />
2123

22-
## Test SQL Statement
24+
### Test SQL Statement
2325

2426
You can use simulated data to execute SQL statements. Before adding actions and creating rules, you can verify whether the SQL execution results meet expectations. This is an optional step, but it is recommended if you are new to EMQX rules. If you want to test the execution of the entire rule, refer to [Test Rule](#test-rule).
2527

@@ -72,7 +74,7 @@ Select **Republish** from the drop-down menu under **Action**, and configure the
7274

7375
![action-republish](./assets/action-republish.png)
7476

75-
On the **Create Rules** page, click the **Create** button at the bottom to complete the rule creation. This rule will be added to as a new entry in the **Rules** page. You can view the rule ID, Source, Enable status, and Action Count. You can also click **Settings** to modify the data source or add more action, or click the **More** button to duplicate or delete the rule.
77+
On the **Create Rule** page, click the **Create** button at the bottom to complete the rule creation. This rule will be added as a new entry on the **Rule** page.
7678

7779
::: tip
7880
The republishing action does not prevent the delivery of the original message. For example, according to the rule, messages under topic "t/1" will be republished under topic "a/1", in the meantime "t/1" message will still be delivered to the clients subscribed to topic "t/1".
@@ -145,13 +147,34 @@ For more usage guides on testing rules, you can refer to the blog [Enhancing Dat
145147

146148
## View Rules
147149

148-
EMQX 5.0 introduced the Flows editor to provide a visualized view of the rules you created. Click **Integration** -> **Flow Designer** to access it. The window shows that you have created two rules for all messages with topics following the "t/#" pattern: "rule_4xjx" publishes the messages and streams data into Kafka, and "rule_z97h" prints the messages to the console.
150+
The **Rule** page provides a comprehensive list of all the rules you have created.
151+
152+
Each entry in the list displays basic information, including the rule ID, associated source, enable status, and the number of actions. Hovering over the source reveals the corresponding SQL statement details. To modify a rule's configuration, click **Settings** in the **Actions** column. You can also use the **More** button to duplicate or delete a rule.
149153

150-
![Flows Editor](./assets/rules/flow-eidtor.png)
154+
![view_rules](./assets/view_rules.png)
151155

152-
You can click the rule ID on the **Flows** page or **Rules** page to view the execution and action statistics parsed by the rule.
156+
You can also view rules in the [Flow Designer](../flow-designer/introduction.md) by navigating to **Integration** -> **Flow Designer**. Rules created on the **Rules** page and those created through the Flow Designer are fully interoperable.
153157

154-
Note: If you update the rule action or redefine the data source, the statistics listed on the page below will reset and start fresh.
158+
To view the execution and action statistics for a rule, click the rule ID on **Rule** page or the rule name on the **Flows** page.
159+
160+
![view_rules_flows](./assets/view_rules_flows.png)
161+
162+
::: tip
163+
164+
If you update the rule action or redefine the data source, the statistics listed on the page below will reset and start fresh.
165+
166+
:::
155167

156168
![Rule Statistics](assets/rule_statistics.png)
157169

170+
### View Actions (Sink) and Sources
171+
172+
The **Actions (Sink)** and **Sources** tabs on the **Rule** page display all created actions (sinks) and sources. You can view essential details, such as names, connection statuses, associated rules, and enable statuses. Clicking the number of associated rules will take you to a list of rules containing that specific action (sink) or source, making it easier to manage your data integration settings.
173+
174+
You can reconnect or modify the settings of an action (sink) or source through the **Action** column. By clicking **More**, you can delete the action (sink) or source, or create a new rule using it.
175+
176+
### Search Rules
177+
178+
When there are many rules in the list, you can use the filter to narrow down your search and display the rules you want to view. You can filter rules by rule ID, incoming message topic or wildcard, enable status, rule notes, and the actions or sources associated with the rule.
179+
180+
![search_rules](./assets/search_rules.png)

zh_CN/changes/changes-ce-v5.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# v5 版本
1+
# EMQX 开源版 v5 版本
22

33
## 5.8.0
44

zh_CN/changes/changes-ee-v5.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# v5 版本
1+
# EMQX 企业版 v5 版本
22

33
## 5.8.0
44

Loading
96.3 KB
Loading
174 KB
Loading
Loading

zh_CN/data-integration/connector.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,9 @@ EMQX 连接器是数据集成的关键概念,它作为 Sink/Source 的底层
5050

5151
如果连接器被 Sink/Source 使用,更新连接器配置会导致 Sink/Source 重新加载,可能会造成数据处理中断,建议在业务低峰期进行更新。
5252

53-
无法删除正在使用的连接器,如果需要删除连接器,需要先删除使用该连接器的 Sink/Source。
53+
正在使用的连接器无法删除。要删除连接器,需先删除使用该连接器的 Sink/Source。当您删除连接器时,会弹出一个警告对话框,显示与该连接器关联的 Sink/Source。点击 Sink/Source 将带您进入规则设置页面,在那里您可以删除 Sink/Source。
54+
55+
![delete_associated_sink](./assets/delete_associated_sink.png)
5456

5557
## 连接器状态
5658

zh_CN/data-integration/rule-get-started.md

+32-4
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
本页面的演示以消息重发布动作作为示例,描述了如何创建一个规则,处理接收到的主题为 `t/#` 的消息,并将消息重新发布到主题 `a/1`
66

7+
此外,本页还介绍了如何测试规则以及如何查看已创建的规则。
8+
79
## 输入规则 SQL
810

911
**规则**页面上,输入规则的名称并添加备注以便未来管理。
@@ -18,7 +20,7 @@ EMQX 内置了丰富的 SQL 语句示例,以帮助您入门。您可以在 **S
1820

1921
<img src="./assets/create-rules.png" alt="create-rules" style="zoom:40%;" />
2022

21-
## 测试 SQL 语句
23+
### 测试 SQL 语句
2224

2325
您可以使用模拟数据执行 SQL 语句,在添加动作和创建规则之前,验证 SQL 执行结果是否符合预期。这是一个可选步骤,但如果您是首次编写 SQL,建议进行测试。如果您想测试整个规则的执行情况,请使用[测试规则](#测试规则)功能。
2426

@@ -74,7 +76,7 @@ SQL 处理结果将以 JSON 形式呈现在**输出结果**部分。SQL 处理
7476

7577
<img src="./assets/action-republish.png" alt="action-republish" style="zoom:50%;" />
7678

77-
**创建规则**页面,点击底部的**创建**按钮以完成规则创建。此规则将作为新条目添加到**规则**页面。您可以查看规则 ID、规则输入、是否启用规则以及动作数量等。您还可以点击**设置**来修改数据源或添加更多操作,或者点击**更多**按钮来复制或删除规则。
79+
**创建规则**页面,点击底部的**创建**按钮以完成规则创建。此规则将作为新条目添加到**规则**页面。
7880

7981
::: tip
8082

@@ -155,12 +157,38 @@ SQL 处理结果将以 JSON 形式呈现在**输出结果**部分。SQL 处理
155157

156158
## 查看规则
157159

158-
EMQX 提供了 [Flow 设计器](../flow-designer/introduction.md),规则处理流程将通过可视化的方式展示出来。您可以在 **集成** -> **Flow 设计器** 页面中查看所有规则的 Flow 视图。
160+
**规则**页面提供了一个完整的列表,显示了您创建的所有规则。
161+
162+
列表中的每个条目都会显示基本信息,包括规则 ID、关联的 Source、启用状态和动作数量。将鼠标悬停在 Source 上可查看对应的 SQL 语句详情。要修改规则的配置,请在**操作**列中点击**设置**。您还可以使用**更多**按钮来复制或删除规则。
159163

160-
![Rule Flow 设计器](./assets/flow-eidtor.png)
164+
![view_rules](./assets/view_rules.png)
161165

162166
您可以在**规则**列表页上点击规则 ID,以查看规则与动作的执行统计信息。
163167

164168
注:如果更新规则,则下面页面中列出的统计指标将重置。
165169

170+
您还可以通过导航到**集成** -> **Flow 设计器**,在 [Flow 设计器](../flow-designer/introduction.md)中查看规则。通过**规则**页面创建的规则与通过 Flow 设计器创建的规则是完全互通的。
171+
172+
要查看规则的执行和动作统计信息,您可以在**规则**页面上点击规则 ID 或在 **Flows** 页面点击规则名称。
173+
174+
![view_rules_flows](./assets/view_rules_flows.png)
175+
176+
::: tip 提示
177+
178+
如果您更新了规则动作或重新定义了数据源,页面上列出的统计信息将重置并刷新。
179+
180+
:::
181+
166182
<img src="./assets/rule-statistics.png" alt="rule-statistics" style="zoom:50%;" />
183+
184+
### 查看动作(Sink)和 Source
185+
186+
**规则**页面上的**动作(Sink)****Source** 标签页显示了所有创建的动作(Sink)和 Source。您可以查看基本信息,如名称、连接状态、关联的规则以及启用状态。点击关联规则的数量会将您带到包含该动作(Sink)或 Source 的规则列表,帮助您更轻松地管理数据集成设置。
187+
188+
您可以通过**操作**列重新连接或修改动作(Sink)或 Source 的设置。点击**更多**,您可以删除该动作(Sink)或 Source,或者使用它创建新规则。
189+
190+
### 搜索规则
191+
192+
当规则列表中有许多规则时,您可以使用过滤器来缩小搜索范围,显示您想要查看的规则。您可以通过规则 ID、传入消息的主题或通配符、启用状态、规则备注以及与规则关联的动作或 Source 来过滤规则。
193+
194+
![search_rules](./assets/search_rules.png)

0 commit comments

Comments
 (0)