Nacos Config Listen Endpoint
endpoint/nacos: subscribes to nacos config; a config change auto-triggers the rule chain. Router from.path is the nacos Data ID (comma-separated for multiple).
Requires extension library: rulego-components-discovery (opens new window)
# Configuration
Inherits Common Connection Config. Extra fields:
| Field | Type | Description | Default |
|---|---|---|---|
| group | string | Config group (endpoint-level, shared by all routers) | DEFAULT_GROUP |
Router:
| Field | Description |
|---|---|
| from.path | Data ID(s) to listen; comma-separated for multiple |
| to.path | Rule chain ID to trigger on change (usually the current chain) |
nacos config listen subscribes per
(dataId, group); wildcards or "listen all" are not supported. To listen to multiple Data IDs, list them comma-separated infrom.path.
# Triggered Message
On config change the rule chain receives:
msg.Data= new config contentmetadata.dataId= the Data ID that changed
# Example
Listen to app.json, trigger the current chain on change (processed by jsTransform):
{
"ruleChain": {"id": "cfg-listen", "root": true},
"metadata": {
"firstNodeIndex": 0,
"endpoints": [
{
"id": "ep_cfg",
"type": "endpoint/nacos",
"configuration": {
"server": "127.0.0.1:8848",
"group": "DEFAULT_GROUP"
},
"routers": [
{"from": {"path": "app.json"}, "to": {"path": "cfg-listen"}}
]
}
],
"nodes": [
{"id": "n1", "type": "jsTransform", "configuration": {
"jsScript": "return {msg:'config['+metadata.dataId+']='+msg,metadata:metadata,msgType:msgType};"
}}
]
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# Related
- Service call: x/nacosServiceCall
- Config read: x/nacosConfigGet
- Config write: x/nacosConfigSet
Edit this page on GitHub (opens new window)
Last Updated: 2026/07/31, 09:31:45