RuleGo RuleGo
🏠Home
  • Quick Start
  • Rule Chain
  • Standard Components
  • Extension Components
  • Custom Components
  • Visualization
  • RuleGo-Server
  • AOP
  • Trigger
  • Advanced Topics
  • Performance
  • Standard Components
  • Extension Components
  • Custom Components
  • Components Marketplace
  • Overview
  • Quick Start
  • Routing
  • DSL
  • API
  • Options
  • Components
🔥Editor (opens new window)
  • RuleGo Editor (opens new window)
  • RuleGo Server (opens new window)
  • StreamSQL
  • AI Agent Framework
  • TPCLAW Agent Platform (opens new window)
  • Github (opens new window)
  • Gitee (opens new window)
  • Changelog (opens new window)
  • English
  • 简体中文
🏠Home
  • Quick Start
  • Rule Chain
  • Standard Components
  • Extension Components
  • Custom Components
  • Visualization
  • RuleGo-Server
  • AOP
  • Trigger
  • Advanced Topics
  • Performance
  • Standard Components
  • Extension Components
  • Custom Components
  • Components Marketplace
  • Overview
  • Quick Start
  • Routing
  • DSL
  • API
  • Options
  • Components
🔥Editor (opens new window)
  • RuleGo Editor (opens new window)
  • RuleGo Server (opens new window)
  • StreamSQL
  • AI Agent Framework
  • TPCLAW Agent Platform (opens new window)
  • Github (opens new window)
  • Gitee (opens new window)
  • Changelog (opens new window)
  • English
  • 简体中文

广告采用随机轮播方式显示 ❤️成为赞助商
  • Quick Start

    • Introduction
    • Use Cases
    • Quick Start
    • Dynamic Refresh Rule Chain
  • Rule Chain

  • Standard Components

  • Extension Components

  • Custom Components

  • Components marketplace

  • Visualization

  • AOP

  • Trigger

  • Advanced Topic

  • Agent Framework

  • RuleGo-Server

  • FAQ

  • Endpoint Module

  • Support

  • StreamSQL

目录

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 in from.path.

# Triggered Message

On config change the rule chain receives:

  • msg.Data = new config content
  • metadata.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

# 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
Theme by Vdoing | Copyright © 2023-2026 RuleGo Team | Apache 2.0 License

  • 跟随系统
  • 浅色模式
  • 深色模式
  • 阅读模式