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 Service Call

x/nacosServiceCall: discovers a healthy instance via nacos, calls the cluster microservice over HTTP, and writes the response to msg.Data. Routes to Success on success, Failure on error (including HTTP ≥ 400).

Requires extension library: rulego-components-discovery (opens new window)

# Configuration

Inherits Common Connection Config. Extra fields:

Field Type Description Default
serviceName string nacos-registered service name none (required)
groupName string Service group DEFAULT_GROUP
method string HTTP method (GET/POST/PUT/DELETE/PATCH) GET
path string Request path, supports ${msg.xx} empty
body string Request body, supports ${msg.xx}; empty uses msg.Data empty

# Behavior

  • Instance selection: picks a healthy instance from nacos with round-robin load balancing.
  • Request body: if body is configured (with ${} template or a literal) it is rendered; otherwise the current message content (msg.Data) is passed through as the body.
  • Response: backend response body is written to msg.Data; HTTP status ≥ 400 triggers Failure.

# Examples

GET call to user-service registered in nacos:

{
  "id": "call_user",
  "type": "x/nacosServiceCall",
  "configuration": {
    "server": "127.0.0.1:8848",
    "serviceName": "user-service",
    "groupName": "DEFAULT_GROUP",
    "method": "GET",
    "path": "/info"
  }
}
1
2
3
4
5
6
7
8
9
10
11

POST with a templated body:

{
  "id": "create_order",
  "type": "x/nacosServiceCall",
  "configuration": {
    "server": "127.0.0.1:8848",
    "serviceName": "order-service",
    "method": "POST",
    "path": "/orders",
    "body": "${msg.payload}"
  }
}
1
2
3
4
5
6
7
8
9
10
11

# Related

  • Config read: x/nacosConfigGet
  • Config write: x/nacosConfigSet
  • Config listen: endpoint/nacos
Edit this page on GitHub (opens new window)
Last Updated: 2026/08/01, 05:05:14
Theme by Vdoing | Copyright © 2023-2026 RuleGo Team | Apache 2.0 License

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