This is an automated email from the ASF dual-hosted git repository.
github-actions[bot] pushed a commit to branch asf-site-v2
in repository https://gitbox.apache.org/repos/asf/dubbo-website.git
The following commit(s) were added to refs/heads/asf-site-v2 by this push:
new 9e3926aabcd deploy: 0a801bafc76be241088358255924f94f3e5baeb8
9e3926aabcd is described below
commit 9e3926aabcd9900b3d53f1c27584d32c3b76d5dc
Author: Alanxtl <[email protected]>
AuthorDate: Mon Aug 24 13:07:50 2026 +0000
deploy: 0a801bafc76be241088358255924f94f3e5baeb8
---
en/index.xml | 16 +----
.../mannual/golang-sdk/tutorial/traffic/index.xml | 16 +----
.../tutorial/traffic/script_router/index.html | 24 +++++---
en/sitemap.xml | 2 +-
sitemap.xml | 2 +-
zh-cn/index.xml | 71 ++++++++++++----------
.../mannual/golang-sdk/tutorial/traffic/index.xml | 67 ++++++++++----------
.../tutorial/traffic/script_router/index.html | 20 ++++--
zh-cn/sitemap.xml | 2 +-
9 files changed, 111 insertions(+), 109 deletions(-)
diff --git a/en/index.xml b/en/index.xml
index a563cdbe78d..369b7cc9945 100644
--- a/en/index.xml
+++ b/en/index.xml
@@ -1099,20 +1099,8 @@ The Istio Bookinfo sample consists of four separate
microservices, each with mul
</ul>
<h2 id="deploying-the-mall-system">Deploying the Mall System</h2>
<p>For convenience, we will deploy the entire system on a Kubernetes
cluster. Execute the following command to complete the mall project deployment.
The source code example is in <a
href="https://github.com/apache/dubbo-samples/tree/master/10-task/dubbo-samples-shop">dubbo-samples/task</a>.</p></description></item><item><title>Script
Router</title><link>https://dubbo.apache.org/en/overview/mannual/golang-sdk/tutorial/traffic/script_router/</link><pubDate>Mon,
01 J [...]
-<h2 id="how-to-use">How to use</h2>
-<h3 id="prerequisites">Prerequisites</h3>
-<ul>
-<li>Docker and Docker Compose environment to deploy Nacos
registry.</li>
-<li>Nacos Version 2.x+</li>
-<li>Go 1.23+</li>
-</ul>
-<h4 id="run-nacos">Run Nacos</h4>
-<p>Follow this instruction
-to <a
href="https://dubbo-next.staged.apache.org/zh-cn/overview/reference/integrations/nacos/">install
and start Nacos server</a>.</p>
-<h3 id="script-router">Script router</h3>
-<p>Similar to the condition router, the script router enables traffic
control using expressions. However,
-while it offers more powerful matching capabilities, this comes at the cost of
higher resource consumption.
-Therefore, it should be used sparingly in production
environments.</p></description></item><item><title>Seata Distributed
Transactions</title><link>https://dubbo.apache.org/en/overview/mannual/golang-sdk/tutorial/transaction/seata/</link><pubDate>Mon,
01 Jan 0001 00:00:00
+0000</pubDate><guid>https://dubbo.apache.org/en/overview/mannual/golang-sdk/tutorial/transaction/seata/</guid><description><ol>
+<p>Script Router runs on the consumer and uses a JavaScript script to
filter candidate providers. It currently supports application-scoped dynamic
rules. Use it when routing decisions depend on runtime information such as a
provider URL, RPC method, or invocation attachment, for example to pin traffic
to a port or select instances by tenant or gray-release marker.</p>
+<p>For simple matching by address, method, or application name, prefer
Condition Router. Script Router is more expressive, but scripts cost more to
execute and maintain. Keep production scripts small and verify that they always
return callable providers.</p></description></item><item><title>Seata
Distributed
Transactions</title><link>https://dubbo.apache.org/en/overview/mannual/golang-sdk/tutorial/transaction/seata/</link><pubDate>Mon,
01 Jan 0001 00:00:00 +0000</pubDate><gui [...]
<li>
<p>First, execute the following command to start the
seata-server.</p>
<div class="highlight"><pre tabindex="0"
style="color:#93a1a1;background-color:#002b36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code
class="language-shell" data-lang="shell"><span
style="display:flex;"><span><span
style="color:#b58900">cd</span> ../dockercompose
diff --git a/en/overview/mannual/golang-sdk/tutorial/traffic/index.xml
b/en/overview/mannual/golang-sdk/tutorial/traffic/index.xml
index 26e7b377cc5..56ce3f2a9a3 100644
--- a/en/overview/mannual/golang-sdk/tutorial/traffic/index.xml
+++ b/en/overview/mannual/golang-sdk/tutorial/traffic/index.xml
@@ -18,20 +18,8 @@ to <a
href="https://dubbo-next.staged.apache.org/zh-cn/overview/reference/int
It uses <code>consumer =&gt; provider</code> expressions to
manage traffic for both providers and consumers.</p>
<p>Expression example:</p>
<p><code>host = 127.0.0.1 =&gt; host = 127.0.0.1,
192.168.1.1</code></p></description></item><item><title>Script
Router</title><link>https://dubbo.apache.org/en/overview/mannual/golang-sdk/tutorial/traffic/script_router/</link><pubDate>Mon,
01 Jan 0001 00:00:00
+0000</pubDate><guid>https://dubbo.apache.org/en/overview/mannual/golang-sdk/tutorial/traffic/script_router/</guid><description><p>Sample
source: <a href="https://github.com/apache/dubbo-go-sam [...]
-<h2 id="how-to-use">How to use</h2>
-<h3 id="prerequisites">Prerequisites</h3>
-<ul>
-<li>Docker and Docker Compose environment to deploy Nacos
registry.</li>
-<li>Nacos Version 2.x+</li>
-<li>Go 1.23+</li>
-</ul>
-<h4 id="run-nacos">Run Nacos</h4>
-<p>Follow this instruction
-to <a
href="https://dubbo-next.staged.apache.org/zh-cn/overview/reference/integrations/nacos/">install
and start Nacos server</a>.</p>
-<h3 id="script-router">Script router</h3>
-<p>Similar to the condition router, the script router enables traffic
control using expressions. However,
-while it offers more powerful matching capabilities, this comes at the cost of
higher resource consumption.
-Therefore, it should be used sparingly in production
environments.</p></description></item><item><title>Tag
Router</title><link>https://dubbo.apache.org/en/overview/mannual/golang-sdk/tutorial/traffic/tag_router/</link><pubDate>Mon,
01 Jan 0001 00:00:00
+0000</pubDate><guid>https://dubbo.apache.org/en/overview/mannual/golang-sdk/tutorial/traffic/tag_router/</guid><description><p>Related
samples:</p>
+<p>Script Router runs on the consumer and uses a JavaScript script to
filter candidate providers. It currently supports application-scoped dynamic
rules. Use it when routing decisions depend on runtime information such as a
provider URL, RPC method, or invocation attachment, for example to pin traffic
to a port or select instances by tenant or gray-release marker.</p>
+<p>For simple matching by address, method, or application name, prefer
Condition Router. Script Router is more expressive, but scripts cost more to
execute and maintain. Keep production scripts small and verify that they always
return callable providers.</p></description></item><item><title>Tag
Router</title><link>https://dubbo.apache.org/en/overview/mannual/golang-sdk/tutorial/traffic/tag_router/</link><pubDate>Mon,
01 Jan 0001 00:00:00 +0000</pubDate><guid>https://dubbo.apa [...]
<ul>
<li>Dynamic tag router: <a
href="https://github.com/apache/dubbo-go-samples/tree/main/router/tag"
target="_blank">dubbo-go-samples/router/tag</a></li>
<li>Static tag router: <a
href="https://github.com/apache/dubbo-go-samples/tree/main/router/static_config/tag"
target="_blank">dubbo-go-samples/router/static_config/tag</a></li>
diff --git
a/en/overview/mannual/golang-sdk/tutorial/traffic/script_router/index.html
b/en/overview/mannual/golang-sdk/tutorial/traffic/script_router/index.html
index f9e7de21e35..e0512fe6d45 100644
--- a/en/overview/mannual/golang-sdk/tutorial/traffic/script_router/index.html
+++ b/en/overview/mannual/golang-sdk/tutorial/traffic/script_router/index.html
@@ -1,4 +1,4 @@
-<!doctype html><html lang=en class=no-js><head><meta name=ROBOTS
content="INDEX, FOLLOW"><link rel=alternate hreflang=zh-cn
href=https://dubbo.apache.org/zh-cn/overview/mannual/golang-sdk/tutorial/traffic/script_router/><link
rel=canonical
href=https://dubbo.apache.org/en/overview/mannual/golang-sdk/tutorial/traffic/script_router/><script>var
_paq=window._paq=window._paq||[];_paq.push(["setDocumentTitle",document.domain+"/"+document.title]),_paq.push(["setCookieDomain","*.dubbo.apache.or
[...]
+<!doctype html><html lang=en class=no-js><head><meta name=ROBOTS
content="INDEX, FOLLOW"><link rel=alternate hreflang=zh-cn
href=https://dubbo.apache.org/zh-cn/overview/mannual/golang-sdk/tutorial/traffic/script_router/><link
rel=canonical
href=https://dubbo.apache.org/en/overview/mannual/golang-sdk/tutorial/traffic/script_router/><script>var
_paq=window._paq=window._paq||[];_paq.push(["setDocumentTitle",document.domain+"/"+document.title]),_paq.push(["setCookieDomain","*.dubbo.apache.or
[...]
<a class=dropdown-item href=/en/overview/notices/>Security Notices</a>
<a class=dropdown-item href=/en/contact/>Contributor's Guide</a></div></li><li
class="nav-item nav-item-line px-2 mb-2 mb-lg-0"><a class=nav-link
href=/en/blog/><span>Blog</span></a></li><li class="nav-item nav-item-line px-2
mb-2 mb-lg-0"><a class=nav-link
href=/en/download/><span>DOWNLOAD</span></a></li><li class="nav-item dropdown
d-lg-block"><a class="nav-link dropdown-toggle" href=# id=navbarDropdown
role=button data-toggle=dropdown aria-haspopup=true
aria-expanded=false>ECOSYSTEM</ [...]
<a class=dropdown-item
href=/zh-cn/overview/mannual/control-plane/>Visualizable Console</a>
@@ -693,12 +693,14 @@
<label for=m-enoverviewnoticesprotocol-check><a
href=/en/overview/notices/protocol/ class="align-left pl-0 td-sidebar-link
td-sidebar-link__page" id=m-enoverviewnoticesprotocol><span>RPC Protocol
Security</span></a></label></li><li class="td-sidebar-nav__section-title
td-sidebar-nav__section without-child" id=m-enoverviewnoticesregistry-li><input
type=checkbox id=m-enoverviewnoticesregistry-check>
<label for=m-enoverviewnoticesregistry-check><a
href=/en/overview/notices/registry/ class="align-left pl-0 td-sidebar-link
td-sidebar-link__page" id=m-enoverviewnoticesregistry><span>Registry Center
Security</span></a></label></li><li class="td-sidebar-nav__section-title
td-sidebar-nav__section without-child" id=m-enoverviewnoticesadmin-li><input
type=checkbox id=m-enoverviewnoticesadmin-check>
<label for=m-enoverviewnoticesadmin-check><a href=/en/overview/notices/admin/
class="align-left pl-0 td-sidebar-link td-sidebar-link__page"
id=m-enoverviewnoticesadmin><span>Dubbo Admin
Security</span></a></label></li><li class="td-sidebar-nav__section-title
td-sidebar-nav__section without-child" id=m-enoverviewnoticeslog4j-li><input
type=checkbox id=m-enoverviewnoticeslog4j-check>
-<label for=m-enoverviewnoticeslog4j-check><a href=/en/overview/notices/log4j/
class="align-left pl-0 td-sidebar-link td-sidebar-link__page"
id=m-enoverviewnoticeslog4j><span>Log4j Vulnerability
Impact</span></a></label></li></ul></li></ul></li></ul></nav></div></div><main
class="col-12 col-md-9 col-xl-8 pl-md-5" role=main><nav aria-label=breadcrumb
class=td-breadcrumbs><ol class=breadcrumb><li class=breadcrumb-item><a
href=/en/overview/>Documentation</a></li><li class=breadcrumb-item><a [...]
-to <a
href=https://dubbo-next.staged.apache.org/zh-cn/overview/reference/integrations/nacos/>install
and start Nacos server</a>.</p><h3 id=script-router>Script
router</h3><p>Similar to the condition router, the script router enables
traffic control using expressions. However,
-while it offers more powerful matching capabilities, this comes at the cost of
higher resource consumption.
-Therefore, it should be used sparingly in production environments.</p><p>The
example code for the script router is similar to that of the condition router,
-with slight differences in the Nacos configuration.
-Therefore, only the Nacos configuration is provided here.</p><div
class=highlight><pre tabindex=0
style=color:#93a1a1;background-color:#002b36;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code
class=language-yaml data-lang=yaml><span style=display:flex><span><span
style=color:#268bd2>scope</span>: <span
style=color:#2aa198>"application"</span>
+<label for=m-enoverviewnoticeslog4j-check><a href=/en/overview/notices/log4j/
class="align-left pl-0 td-sidebar-link td-sidebar-link__page"
id=m-enoverviewnoticeslog4j><span>Log4j Vulnerability
Impact</span></a></label></li></ul></li></ul></li></ul></nav></div></div><main
class="col-12 col-md-9 col-xl-8 pl-md-5" role=main><nav aria-label=breadcrumb
class=td-breadcrumbs><ol class=breadcrumb><li class=breadcrumb-item><a
href=/en/overview/>Documentation</a></li><li class=breadcrumb-item><a [...]
+</span></span><span style=display:flex><span> <span
style=color:#719e07>if</span> (<span style=color:#719e07>!</span>invokers <span
style=color:#719e07>||</span> invokers.length <span
style=color:#719e07>===</span> <span style=color:#2aa198>0</span>) <span
style=color:#719e07>return</span> [];
+</span></span><span style=display:flex><span> <span
style=color:#719e07>return</span> invokers.filter(<span
style=color:#268bd2>function</span>(invoker) {
+</span></span><span style=display:flex><span> <span
style=color:#268bd2>var</span> url <span style=color:#719e07>=</span>
invoker.GetURL();
+</span></span><span style=display:flex><span> <span
style=color:#719e07>return</span> url <span
style=color:#719e07>&&</span> url.Port <span
style=color:#719e07>===</span> <span style=color:#2aa198>"20000"</span>;
+</span></span><span style=display:flex><span> });
+</span></span><span style=display:flex><span>})(invokers, invocation, context);
+</span></span></code></pre></div><h2 id=configure-script-router>Configure
Script Router</h2><p>The sample consumer connects to the Nacos configuration
center through <code>dubbo.WithConfigCenter</code>. After the providers start,
Script Router subscribes to the rule for the provider application.</p><p>Create
the following configuration in
Nacos:</p><table><thead><tr><th>Setting</th><th>Value</th></tr></thead><tbody><tr><td>Data
ID</td><td><code>script-server.script-router</code></td></tr [...]
</span></span><span style=display:flex><span><span
style=color:#268bd2>key</span>: <span
style=color:#2aa198>"script-server"</span>
</span></span><span style=display:flex><span><span
style=color:#268bd2>enabled</span>: <span style=color:#cb4b16>true</span>
</span></span><span style=display:flex><span><span
style=color:#268bd2>type</span>: <span
style=color:#2aa198>"javascript"</span>
@@ -710,8 +712,12 @@ Therefore, only the Nacos configuration is provided
here.</p><div class=highligh
</span></span></span><span style=display:flex><span><span style=color:#2aa198>
return url && url.Port === "20000";
</span></span></span><span style=display:flex><span><span style=color:#2aa198>
});
</span></span></span><span style=display:flex><span><span style=color:#2aa198>
})(invokers, invocation, context);</span>
-</span></span></code></pre></div><div id=pre-footer><h2>Feedback</h2><p
class=feedback--prompt>Was this page helpful?</p><button class="btn btn-primary
mb-4 feedback--yes">Yes</button>
-<button class="btn btn-primary mb-4
feedback--no">No</button></div><script>const
yes=document.querySelector(".feedback--yes"),no=document.querySelector(".feedback--no");document.querySelectorAll(".feedback--link").forEach(e=>{e.href=e.href+window.location.pathname});const
sendFeedback=e=>{gtag||console.log("!gtag"),gtag("event","click",{event_category:"Helpful",event_label:window.location.pathname,value:e})},disableButtons=()=>{yes.disabled=!0,yes.classList.add("feedback--button__disable
[...]
+</span></span></code></pre></div><p>Field
descriptions:</p><table><thead><tr><th>Field</th><th>Description</th></tr></thead><tbody><tr><td><code>scope</code></td><td>The
Script Router scope; use
<code>application</code>.</td></tr><tr><td><code>key</code></td><td>The
application name of the target
provider.</td></tr><tr><td><code>enabled</code></td><td>Whether to enable the
rule; <code>false</code> skips script
execution.</td></tr><tr><td><code>type</code></td><td>The script type; the sam
[...]
+</span></span><span style=display:flex><span>go run
./go-node2-server/cmd/server_node2.go <span style=color:#586e75># port
20001</span>
+</span></span></code></pre></div><p>Then start the consumer:</p><div
class=highlight><pre tabindex=0
style=color:#93a1a1;background-color:#002b36;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code
class=language-bash data-lang=bash><span style=display:flex><span>go run
./go-client/cmd/client.go
+</span></span></code></pre></div><p>The consumer calls <code>Greet</code>
every five seconds. Before the rule is published in Nacos, responses alternate
between providers on <code>20000</code> and <code>20001</code>. After saving
the rule, the consumer does not need to restart and subsequent logs should only
contain port <code>20000</code>:</p><div class=highlight><pre tabindex=0
style=color:#93a1a1;background-color:#002b36;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code
class=language-te [...]
+</span></span></code></pre></div><p>Delete the Nacos configuration or set
<code>enabled</code> to <code>false</code> to allow calls to route to both
providers again. If the rule does not take effect, check the Data ID, Group,
configuration-center connection, and script return value.</p><h2
id=script-router-vs-condition-router>Script Router vs. Condition
Router</h2><table><thead><tr><th>Aspect</th><th>Script Router</th><th>Condition
Router</th></tr></thead><tbody><tr><td>Rule expression</ [...]
+<button class="btn btn-primary mb-4
feedback--no">No</button></div><script>const
yes=document.querySelector(".feedback--yes"),no=document.querySelector(".feedback--no");document.querySelectorAll(".feedback--link").forEach(e=>{e.href=e.href+window.location.pathname});const
sendFeedback=e=>{gtag||console.log("!gtag"),gtag("event","click",{event_category:"Helpful",event_label:window.location.pathname,value:e})},disableButtons=()=>{yes.disabled=!0,yes.classList.add("feedback--button__disable
[...]
<button class="contact-btn qr-container"
onmouseover='showQRCode("dingding-qr")'
onmouseout='hideQRCode("dingding-qr")'>DINGTALK CHANNEL<div class=qr-code
id=dingding-qr style=display:none><img
src=https://img.alicdn.com/imgextra/i4/O1CN01buuadT274Lj33QZWQ_!!6000000007743-0-tps-1170-1477.jpg
alt="DingTalk QR Code"></div></button>
<button class=contact-btn><a
href=https://github.com/apache/dubbo/>GitHub</a></button></div></div><div
class=footer-container-right><ul><li>DOCUMENTATION</li><li><a
href=/en/overview/>Overview</a></li><li><a href=/en/overview/quickstart/>Quick
Start</a></li><li><a
href=/en/contact/contributor/software-donation-guide_dev/>Developer
guide</a></li></ul><ul><li>RESOURCES</li><li><a
href=/en/contact/>Community</a></li></ul></div></div><div
style="width:85.125rem;height:0;border:1px solid #ddd [...]
project logo are either registered trademarks or trademarks of The Apache
Software Foundation in the United States
diff --git a/en/sitemap.xml b/en/sitemap.xml
index 51be3bfb476..977ac00acaf 100644
--- a/en/sitemap.xml
+++ b/en/sitemap.xml
@@ -1 +1 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes"?><urlset
xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
xmlns:xhtml="http://www.w3.org/1999/xhtml"><url><loc>https://dubbo.apache.org/en/blog/2023/01/16/alibaba-upgrades-dubbo3-to-fully-replace-hsf2/</loc><lastmod>2024-09-30T17:53:33+08:00</lastmod><changefreq>monthly</changefreq><priority>0.5</priority><xhtml:link
rel="alternate" hreflang="zh-cn"
href="https://dubbo.apache.org/zh-cn/blog/2023/01/16/%E9%98%BF%E9%87%8C%E5%B7%B4%E5
[...]
\ No newline at end of file
+<?xml version="1.0" encoding="utf-8" standalone="yes"?><urlset
xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
xmlns:xhtml="http://www.w3.org/1999/xhtml"><url><loc>https://dubbo.apache.org/en/blog/2023/01/16/alibaba-upgrades-dubbo3-to-fully-replace-hsf2/</loc><lastmod>2024-09-30T17:53:33+08:00</lastmod><changefreq>monthly</changefreq><priority>0.5</priority><xhtml:link
rel="alternate" hreflang="zh-cn"
href="https://dubbo.apache.org/zh-cn/blog/2023/01/16/%E9%98%BF%E9%87%8C%E5%B7%B4%E5
[...]
\ No newline at end of file
diff --git a/sitemap.xml b/sitemap.xml
index d0776fa939f..2bfaf388b5f 100644
--- a/sitemap.xml
+++ b/sitemap.xml
@@ -1 +1 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes"?><sitemapindex
xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"><sitemap><loc>https://dubbo.apache.org/zh-cn/sitemap.xml</loc><lastmod>2026-08-17T18:54:46+08:00</lastmod></sitemap><sitemap><loc>https://dubbo.apache.org/en/sitemap.xml</loc><lastmod>2026-08-17T18:54:46+08:00</lastmod></sitemap></sitemapindex>
\ No newline at end of file
+<?xml version="1.0" encoding="utf-8" standalone="yes"?><sitemapindex
xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"><sitemap><loc>https://dubbo.apache.org/zh-cn/sitemap.xml</loc><lastmod>2026-08-24T21:00:49+08:00</lastmod></sitemap><sitemap><loc>https://dubbo.apache.org/en/sitemap.xml</loc><lastmod>2026-08-24T21:00:49+08:00</lastmod></sitemap></sitemapindex>
\ No newline at end of file
diff --git a/zh-cn/index.xml b/zh-cn/index.xml
index 779322116b2..927d572b34f 100644
--- a/zh-cn/index.xml
+++ b/zh-cn/index.xml
@@ -7715,50 +7715,55 @@ Zipkin: <a
href="https://github.com/openzipkin/zipkin-helm">https://github
</ul>
<h2 id="一站式微服务解决方案">一站式微服务解决方案</h2>
<p>Dubbo
提供了从服务定义、服务发现、服务通信到流量管控等几乎所有的服务治理能力,并且尝试从使用上对用户屏蔽底层细节,以提供更好的易用性。</p></description></item><item><title>脚本路由</title><link>https://dubbo.apache.org/zh-cn/overview/mannual/golang-sdk/tutorial/traffic/script_router/</link><pubDate>Mon,
01 Jan 0001 00:00:00
+0000</pubDate><guid>https://dubbo.apache.org/zh-cn/overview/mannual/golang-sdk/tutorial/traffic/script_router/</guid><description><p>示例源码:<a
href="https://github.com/apache/dubbo-go-samples/tree/main/router/sc [...]
-<h2 id="使用方法">使用方法</h2>
-<h3 id="前置准备">前置准备</h3>
-<ul>
-<li>Docker 以及 Docker compose 环境来部署Nacos配置中心。</li>
-<li>Nacos 2.x+</li>
-<li>Go 1.23+</li>
-</ul>
-<h4 id="启动nacos配置中心">启动Nacos配置中心</h4>
-<p>参考这个教程来<a
href="https://dubbo-next.staged.apache.org/zh-cn/overview/reference/integrations/nacos/">启动Nacos</a>。</p>
-<h3 id="script-router-介绍">Script router 介绍</h3>
-<p>Script router与condition router类似,都提供了使用表达式进行流量管控的功能。
-但是Script router具有更强大的匹配功能,与此同时带来的是匹配消耗的资源更多,因此在生产环境中应当尽量少使用。</p>
-<p>Script router的示例代码与Condition
router类似,在nacos配置上略有差别,这里仅提供nacos上的简单配置。</p>
-<div class="highlight"><pre tabindex="0"
style="color:#93a1a1;background-color:#002b36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code
class="language-yaml" data-lang="yaml"><span
style="display:flex;"><span><span
style="color:#268bd2">scope</span>: <span
style="color:#2aa198">&#34;application&#34;</span>
-</span></span><span
style="display:flex;"><span><span
style="color:#268bd2">key</span>: <span
style="color:#2aa198">&#34;script-server&#34;</span>
-</span></span><span
style="display:flex;"><span><span
style="color:#268bd2">enabled</span>: <span
style="color:#cb4b16">true</span>
-</span></span><span
style="display:flex;"><span><span
style="color:#268bd2">type</span>: <span
style="color:#2aa198">&#34;javascript&#34;</span>
-</span></span><span
style="display:flex;"><span><span
style="color:#268bd2">script</span>: |<span
style="color:#2aa198">
-</span></span></span><span
style="display:flex;"><span><span style="color:#2aa198">
(function(invokers, invocation, context) {
-</span></span></span><span
style="display:flex;"><span><span style="color:#2aa198"> if
(!invokers || invokers.length === 0) return [];
-</span></span></span><span
style="display:flex;"><span><span style="color:#2aa198"> return
invokers.filter(function(invoker) {
-</span></span></span><span
style="display:flex;"><span><span style="color:#2aa198"> var url
= invoker.GetURL();
-</span></span></span><span
style="display:flex;"><span><span style="color:#2aa198"> return
url &amp;&amp; url.Port === &#34;20000&#34;;
-</span></span></span><span
style="display:flex;"><span><span style="color:#2aa198"> });
-</span></span></span><span
style="display:flex;"><span><span style="color:#2aa198">
})(invokers, invocation, context);</span>
-</span></span></code></pre></div><p>参数说明:</p>
+<p>Script Router 在消费端通过 JavaScript 脚本筛选候选 Provider,目前支持应用级动态规则。它适合根据
Provider URL、RPC 方法、调用附件等运行时信息实现自定义路由,例如将流量固定到指定端口、按租户或灰度标识选择实例。</p>
+<p>对于只需按地址、方法或应用名进行简单匹配的场景,优先使用 Condition Router。Script Router
的表达能力更强,但脚本执行和维护成本更高,生产环境应限制脚本复杂度,并验证脚本始终返回可调用的 Provider 列表。</p>
+<h2 id="前置准备">前置准备</h2>
+<ul>
+<li>Docker 和 Docker Compose,用于运行 Nacos。</li>
+<li>Nacos 2.x+。</li>
+<li>Go 1.23+。</li>
+<li>已下载 <code>dubbo-go-samples/router/script</code>
示例。</li>
+</ul>
+<h3 id="启动-nacos">启动 Nacos</h3>
+<p>按照 <a
href="https://dubbo-next.staged.apache.org/zh-cn/overview/reference/integrations/nacos/">Nacos
快速开始</a> 启动 Nacos。示例中的注册中心和配置中心地址均为
<code>127.0.0.1:8848</code>。</p>
+<h2 id="脚本入参">脚本入参</h2>
+<p>路由脚本以
<code>invokers</code>、<code>invocation</code>、<code>context</code>
三个参数执行,必须返回由原始候选项组成的数组。</p>
<table>
<thead>
<tr>
- <th>参数</th>
- <th>说明</th>
+ <th>入参</th>
+ <th>含义</th>
+ <th>常见用法</th>
</tr>
</thead>
<tbody>
<tr>
- <td>type</td>
- <td>script的类型,目前仅可使用js</td>
+ <td><code>invokers</code></td>
+ <td>当前可用的候选 Provider 列表。每项可通过 <code>GetURL()</code> 获取服务
URL。</td>
+ <td>根据 URL 的端口、地址或参数过滤实例。</td>
</tr>
<tr>
- <td>script</td>
- <td>script实际内容</td>
+ <td><code>invocation</code></td>
+ <td>当前 RPC 调用信息。</td>
+ <td>根据方法名、参数或 attachments 实现按调用维度的路由。</td>
+ </tr>
+ <tr>
+ <td><code>context</code></td>
+ <td>当前调用上下文。</td>
+ <td>在脚本需要时读取调用链路中的上下文信息。</td>
</tr>
</tbody>
-</table></description></item><item><title>接入 Ingress
流量</title><link>https://dubbo.apache.org/zh-cn/overview/mannual/golang-sdk/tutorial/gateway/http_triple/</link><pubDate>Mon,
01 Jan 0001 00:00:00
+0000</pubDate><guid>https://dubbo.apache.org/zh-cn/overview/mannual/golang-sdk/tutorial/gateway/http_triple/</guid><description><h2
id="1-准备工作">1. 准备工作</h2>
+</table>
+<p>下面的脚本只保留端口为 <code>20000</code> 的 Provider:</p>
+<div class="highlight"><pre tabindex="0"
style="color:#93a1a1;background-color:#002b36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code
class="language-javascript" data-lang="javascript"><span
style="display:flex;"><span>(<span
style="color:#268bd2">function</span>(invokers, invocation, context) {
+</span></span><span style="display:flex;"><span>
<span style="color:#719e07">if</span> (<span
style="color:#719e07">!</span>invokers <span
style="color:#719e07">||</span> invokers.length <span
style="color:#719e07">===</span> <span
style="color:#2aa198">0</span>) <span
style="color:#719e07">return</span> [];
+</span></span><span style="display:flex;"><span>
<span style="color:#719e07">return</span> invokers.filter(<span
style="color:#268bd2">function</span>(invoker) {
+</span></span><span style="display:flex;"><span>
<span style="color:#268bd2">var</span> url <span
style="color:#719e07">=</span> invoker.GetURL();
+</span></span><span style="display:flex;"><span>
<span style="color:#719e07">return</span> url <span
style="color:#719e07">&amp;&amp;</span> url.Port <span
style="color:#719e07">===</span> <span
style="color:#2aa198">&#34;20000&#34;</span>;
+</span></span><span style="display:flex;"><span> });
+</span></span><span
style="display:flex;"><span>})(invokers, invocation, context);
+</span></span></code></pre></div><h2
id="配置-script-router">配置 Script Router</h2>
+<p>示例 consumer 通过 <code>dubbo.WithConfigCenter</code> 连接
Nacos 配置中心。启动 Provider 后,Script Router 会按照 Provider
的应用名订阅规则。</p></description></item><item><title>接入 Ingress
流量</title><link>https://dubbo.apache.org/zh-cn/overview/mannual/golang-sdk/tutorial/gateway/http_triple/</link><pubDate>Mon,
01 Jan 0001 00:00:00
+0000</pubDate><guid>https://dubbo.apache.org/zh-cn/overview/mannual/golang-sdk/tutorial/gateway/http_triple/</guid><description><h2
id="1-准备工作">1. 准 [...]
<ul>
<li>kubectl</li>
<li>一个 k8s 集群,配置好 kubeconfig</li>
diff --git a/zh-cn/overview/mannual/golang-sdk/tutorial/traffic/index.xml
b/zh-cn/overview/mannual/golang-sdk/tutorial/traffic/index.xml
index 92ce964b109..114960b628d 100644
--- a/zh-cn/overview/mannual/golang-sdk/tutorial/traffic/index.xml
+++ b/zh-cn/overview/mannual/golang-sdk/tutorial/traffic/index.xml
@@ -39,50 +39,55 @@
</span></span><span style="display:flex;"><span>ctx
<span style="color:#719e07">:=</span> context.<span
style="color:#268bd2">WithValue</span>(context.<span
style="color:#268bd2">Background</span>(), constant.AttachmentKey,
atta)
</span></span><span style="display:flex;"><span>resp,
err <span style="color:#719e07">:=</span> svc.<span
style="color:#268bd2">Greet</span>(ctx, <span
style="color:#719e07">&amp;</span>greet.GreetRequest{Name: name})
</span></span></code></pre></div><p>参数:</p></description></item><item><title>脚本路由</title><link>https://dubbo.apache.org/zh-cn/overview/mannual/golang-sdk/tutorial/traffic/script_router/</link><pubDate>Mon,
01 Jan 0001 00:00:00
+0000</pubDate><guid>https://dubbo.apache.org/zh-cn/overview/mannual/golang-sdk/tutorial/traffic/script_router/</guid><description><p>示例源码:<a
href="https://github.com/apache/dubbo-go-samples/tree/main/router/script [...]
-<h2 id="使用方法">使用方法</h2>
-<h3 id="前置准备">前置准备</h3>
+<p>Script Router 在消费端通过 JavaScript 脚本筛选候选 Provider,目前支持应用级动态规则。它适合根据
Provider URL、RPC 方法、调用附件等运行时信息实现自定义路由,例如将流量固定到指定端口、按租户或灰度标识选择实例。</p>
+<p>对于只需按地址、方法或应用名进行简单匹配的场景,优先使用 Condition Router。Script Router
的表达能力更强,但脚本执行和维护成本更高,生产环境应限制脚本复杂度,并验证脚本始终返回可调用的 Provider 列表。</p>
+<h2 id="前置准备">前置准备</h2>
<ul>
-<li>Docker 以及 Docker compose 环境来部署Nacos配置中心。</li>
-<li>Nacos 2.x+</li>
-<li>Go 1.23+</li>
+<li>Docker 和 Docker Compose,用于运行 Nacos。</li>
+<li>Nacos 2.x+。</li>
+<li>Go 1.23+。</li>
+<li>已下载 <code>dubbo-go-samples/router/script</code>
示例。</li>
</ul>
-<h4 id="启动nacos配置中心">启动Nacos配置中心</h4>
-<p>参考这个教程来<a
href="https://dubbo-next.staged.apache.org/zh-cn/overview/reference/integrations/nacos/">启动Nacos</a>。</p>
-<h3 id="script-router-介绍">Script router 介绍</h3>
-<p>Script router与condition router类似,都提供了使用表达式进行流量管控的功能。
-但是Script router具有更强大的匹配功能,与此同时带来的是匹配消耗的资源更多,因此在生产环境中应当尽量少使用。</p>
-<p>Script router的示例代码与Condition
router类似,在nacos配置上略有差别,这里仅提供nacos上的简单配置。</p>
-<div class="highlight"><pre tabindex="0"
style="color:#93a1a1;background-color:#002b36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code
class="language-yaml" data-lang="yaml"><span
style="display:flex;"><span><span
style="color:#268bd2">scope</span>: <span
style="color:#2aa198">&#34;application&#34;</span>
-</span></span><span
style="display:flex;"><span><span
style="color:#268bd2">key</span>: <span
style="color:#2aa198">&#34;script-server&#34;</span>
-</span></span><span
style="display:flex;"><span><span
style="color:#268bd2">enabled</span>: <span
style="color:#cb4b16">true</span>
-</span></span><span
style="display:flex;"><span><span
style="color:#268bd2">type</span>: <span
style="color:#2aa198">&#34;javascript&#34;</span>
-</span></span><span
style="display:flex;"><span><span
style="color:#268bd2">script</span>: |<span
style="color:#2aa198">
-</span></span></span><span
style="display:flex;"><span><span style="color:#2aa198">
(function(invokers, invocation, context) {
-</span></span></span><span
style="display:flex;"><span><span style="color:#2aa198"> if
(!invokers || invokers.length === 0) return [];
-</span></span></span><span
style="display:flex;"><span><span style="color:#2aa198"> return
invokers.filter(function(invoker) {
-</span></span></span><span
style="display:flex;"><span><span style="color:#2aa198"> var url
= invoker.GetURL();
-</span></span></span><span
style="display:flex;"><span><span style="color:#2aa198"> return
url &amp;&amp; url.Port === &#34;20000&#34;;
-</span></span></span><span
style="display:flex;"><span><span style="color:#2aa198"> });
-</span></span></span><span
style="display:flex;"><span><span style="color:#2aa198">
})(invokers, invocation, context);</span>
-</span></span></code></pre></div><p>参数说明:</p>
+<h3 id="启动-nacos">启动 Nacos</h3>
+<p>按照 <a
href="https://dubbo-next.staged.apache.org/zh-cn/overview/reference/integrations/nacos/">Nacos
快速开始</a> 启动 Nacos。示例中的注册中心和配置中心地址均为
<code>127.0.0.1:8848</code>。</p>
+<h2 id="脚本入参">脚本入参</h2>
+<p>路由脚本以
<code>invokers</code>、<code>invocation</code>、<code>context</code>
三个参数执行,必须返回由原始候选项组成的数组。</p>
<table>
<thead>
<tr>
- <th>参数</th>
- <th>说明</th>
+ <th>入参</th>
+ <th>含义</th>
+ <th>常见用法</th>
</tr>
</thead>
<tbody>
<tr>
- <td>type</td>
- <td>script的类型,目前仅可使用js</td>
+ <td><code>invokers</code></td>
+ <td>当前可用的候选 Provider 列表。每项可通过 <code>GetURL()</code> 获取服务
URL。</td>
+ <td>根据 URL 的端口、地址或参数过滤实例。</td>
+ </tr>
+ <tr>
+ <td><code>invocation</code></td>
+ <td>当前 RPC 调用信息。</td>
+ <td>根据方法名、参数或 attachments 实现按调用维度的路由。</td>
</tr>
<tr>
- <td>script</td>
- <td>script实际内容</td>
+ <td><code>context</code></td>
+ <td>当前调用上下文。</td>
+ <td>在脚本需要时读取调用链路中的上下文信息。</td>
</tr>
</tbody>
-</table></description></item><item><title>条件路由</title><link>https://dubbo.apache.org/zh-cn/overview/mannual/golang-sdk/tutorial/traffic/condition_router/</link><pubDate>Mon,
01 Jan 0001 00:00:00
+0000</pubDate><guid>https://dubbo.apache.org/zh-cn/overview/mannual/golang-sdk/tutorial/traffic/condition_router/</guid><description><p>相关示例:</p>
+</table>
+<p>下面的脚本只保留端口为 <code>20000</code> 的 Provider:</p>
+<div class="highlight"><pre tabindex="0"
style="color:#93a1a1;background-color:#002b36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code
class="language-javascript" data-lang="javascript"><span
style="display:flex;"><span>(<span
style="color:#268bd2">function</span>(invokers, invocation, context) {
+</span></span><span style="display:flex;"><span>
<span style="color:#719e07">if</span> (<span
style="color:#719e07">!</span>invokers <span
style="color:#719e07">||</span> invokers.length <span
style="color:#719e07">===</span> <span
style="color:#2aa198">0</span>) <span
style="color:#719e07">return</span> [];
+</span></span><span style="display:flex;"><span>
<span style="color:#719e07">return</span> invokers.filter(<span
style="color:#268bd2">function</span>(invoker) {
+</span></span><span style="display:flex;"><span>
<span style="color:#268bd2">var</span> url <span
style="color:#719e07">=</span> invoker.GetURL();
+</span></span><span style="display:flex;"><span>
<span style="color:#719e07">return</span> url <span
style="color:#719e07">&amp;&amp;</span> url.Port <span
style="color:#719e07">===</span> <span
style="color:#2aa198">&#34;20000&#34;</span>;
+</span></span><span style="display:flex;"><span> });
+</span></span><span
style="display:flex;"><span>})(invokers, invocation, context);
+</span></span></code></pre></div><h2
id="配置-script-router">配置 Script Router</h2>
+<p>示例 consumer 通过 <code>dubbo.WithConfigCenter</code> 连接
Nacos 配置中心。启动 Provider 后,Script Router 会按照 Provider
的应用名订阅规则。</p></description></item><item><title>条件路由</title><link>https://dubbo.apache.org/zh-cn/overview/mannual/golang-sdk/tutorial/traffic/condition_router/</link><pubDate>Mon,
01 Jan 0001 00:00:00
+0000</pubDate><guid>https://dubbo.apache.org/zh-cn/overview/mannual/golang-sdk/tutorial/traffic/condition_router/</guid><description><p>相关示例:</p>
<ul>
<li>动态 condition router:<a
href="https://github.com/apache/dubbo-go-samples/tree/main/router/condition"
target="_blank">dubbo-go-samples/router/condition</a></li>
<li>静态 condition router:<a
href="https://github.com/apache/dubbo-go-samples/tree/main/router/static_config/condition"
target="_blank">dubbo-go-samples/router/static_config/condition</a></li>
diff --git
a/zh-cn/overview/mannual/golang-sdk/tutorial/traffic/script_router/index.html
b/zh-cn/overview/mannual/golang-sdk/tutorial/traffic/script_router/index.html
index f13e675b2ae..7ab3baa8a63 100644
---
a/zh-cn/overview/mannual/golang-sdk/tutorial/traffic/script_router/index.html
+++
b/zh-cn/overview/mannual/golang-sdk/tutorial/traffic/script_router/index.html
@@ -1,4 +1,4 @@
-<!doctype html><html lang=zh-cn class=no-js><head><meta name=ROBOTS
content="INDEX, FOLLOW"><link rel=alternate hreflang=en
href=https://dubbo.apache.org/en/overview/mannual/golang-sdk/tutorial/traffic/script_router/><link
rel=canonical
href=https://dubbo.apache.org/zh-cn/overview/mannual/golang-sdk/tutorial/traffic/script_router/><script>var
_paq=window._paq=window._paq||[];_paq.push(["setDocumentTitle",document.domain+"/"+document.title]),_paq.push(["setCookieDomain","*.dubbo.apache.or
[...]
+<!doctype html><html lang=zh-cn class=no-js><head><meta name=ROBOTS
content="INDEX, FOLLOW"><link rel=alternate hreflang=en
href=https://dubbo.apache.org/en/overview/mannual/golang-sdk/tutorial/traffic/script_router/><link
rel=canonical
href=https://dubbo.apache.org/zh-cn/overview/mannual/golang-sdk/tutorial/traffic/script_router/><script>var
_paq=window._paq=window._paq||[];_paq.push(["setDocumentTitle",document.domain+"/"+document.title]),_paq.push(["setCookieDomain","*.dubbo.apache.or
[...]
<a class=dropdown-item href=/zh-cn/overview/notices/>安全公告</a>
<a class=dropdown-item href=/zh-cn/contact/>贡献者指南</a></div></li><li
class="nav-item nav-item-line px-2 mb-2 mb-lg-0"><a class=nav-link
href=/zh-cn/blog/><span>博客</span></a></li><li class="nav-item nav-item-line
px-2 mb-2 mb-lg-0"><a class=nav-link
href=/zh-cn/download/><span>下载</span></a></li><li class="nav-item dropdown
d-lg-block"><a class="nav-link dropdown-toggle" href=# id=navbarDropdown
role=button data-toggle=dropdown aria-haspopup=true
aria-expanded=false>生态</a><div class="dropdo [...]
<a class=dropdown-item href=/zh-cn/overview/mannual/control-plane/>可视化控制台</a>
@@ -688,8 +688,14 @@
<label for=m-zh-cnoverviewnoticesprotocol-check><a
href=/zh-cn/overview/notices/protocol/ class="align-left pl-0 td-sidebar-link
td-sidebar-link__page" id=m-zh-cnoverviewnoticesprotocol><span>RPC
协议安全</span></a></label></li><li class="td-sidebar-nav__section-title
td-sidebar-nav__section without-child"
id=m-zh-cnoverviewnoticesregistry-li><input type=checkbox
id=m-zh-cnoverviewnoticesregistry-check>
<label for=m-zh-cnoverviewnoticesregistry-check><a
href=/zh-cn/overview/notices/registry/ class="align-left pl-0 td-sidebar-link
td-sidebar-link__page"
id=m-zh-cnoverviewnoticesregistry><span>注册中心安全</span></a></label></li><li
class="td-sidebar-nav__section-title td-sidebar-nav__section without-child"
id=m-zh-cnoverviewnoticesadmin-li><input type=checkbox
id=m-zh-cnoverviewnoticesadmin-check>
<label for=m-zh-cnoverviewnoticesadmin-check><a
href=/zh-cn/overview/notices/admin/ class="align-left pl-0 td-sidebar-link
td-sidebar-link__page" id=m-zh-cnoverviewnoticesadmin><span>Dubbo Admin
安全</span></a></label></li><li class="td-sidebar-nav__section-title
td-sidebar-nav__section without-child" id=m-zh-cnoverviewnoticeslog4j-li><input
type=checkbox id=m-zh-cnoverviewnoticeslog4j-check>
-<label for=m-zh-cnoverviewnoticeslog4j-check><a
href=/zh-cn/overview/notices/log4j/ class="align-left pl-0 td-sidebar-link
td-sidebar-link__page" id=m-zh-cnoverviewnoticeslog4j><span>Log4j
漏洞影响</span></a></label></li></ul></li></ul></li></ul></nav></div></div><main
class="col-12 col-md-9 col-xl-8 pl-md-5" role=main><nav aria-label=breadcrumb
class=td-breadcrumbs><ol class=breadcrumb><li class=breadcrumb-item><a
href=/zh-cn/overview/>文档</a></li><li class=breadcrumb-item><a href=/zh-cn/ove
[...]
-但是Script router具有更强大的匹配功能,与此同时带来的是匹配消耗的资源更多,因此在生产环境中应当尽量少使用。</p><p>Script
router的示例代码与Condition router类似,在nacos配置上略有差别,这里仅提供nacos上的简单配置。</p><div
class=highlight><pre tabindex=0
style=color:#93a1a1;background-color:#002b36;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code
class=language-yaml data-lang=yaml><span style=display:flex><span><span
style=color:#268bd2>scope</span>: <span
style=color:#2aa198>"application"</span>
+<label for=m-zh-cnoverviewnoticeslog4j-check><a
href=/zh-cn/overview/notices/log4j/ class="align-left pl-0 td-sidebar-link
td-sidebar-link__page" id=m-zh-cnoverviewnoticeslog4j><span>Log4j
漏洞影响</span></a></label></li></ul></li></ul></li></ul></nav></div></div><main
class="col-12 col-md-9 col-xl-8 pl-md-5" role=main><nav aria-label=breadcrumb
class=td-breadcrumbs><ol class=breadcrumb><li class=breadcrumb-item><a
href=/zh-cn/overview/>文档</a></li><li class=breadcrumb-item><a href=/zh-cn/ove
[...]
+</span></span><span style=display:flex><span> <span
style=color:#719e07>if</span> (<span style=color:#719e07>!</span>invokers <span
style=color:#719e07>||</span> invokers.length <span
style=color:#719e07>===</span> <span style=color:#2aa198>0</span>) <span
style=color:#719e07>return</span> [];
+</span></span><span style=display:flex><span> <span
style=color:#719e07>return</span> invokers.filter(<span
style=color:#268bd2>function</span>(invoker) {
+</span></span><span style=display:flex><span> <span
style=color:#268bd2>var</span> url <span style=color:#719e07>=</span>
invoker.GetURL();
+</span></span><span style=display:flex><span> <span
style=color:#719e07>return</span> url <span
style=color:#719e07>&&</span> url.Port <span
style=color:#719e07>===</span> <span style=color:#2aa198>"20000"</span>;
+</span></span><span style=display:flex><span> });
+</span></span><span style=display:flex><span>})(invokers, invocation, context);
+</span></span></code></pre></div><h2 id=配置-script-router>配置 Script
Router</h2><p>示例 consumer 通过 <code>dubbo.WithConfigCenter</code> 连接 Nacos
配置中心。启动 Provider 后,Script Router 会按照 Provider 的应用名订阅规则。</p><p>在 Nacos
配置中心新增配置:</p><table><thead><tr><th>配置项</th><th>值</th></tr></thead><tbody><tr><td>Data
ID</td><td><code>script-server.script-router</code></td></tr><tr><td>Group</td><td><code>DEFAULT_GROUP</code></td></tr><tr><td>格式</td><td><code>YAML</code></td></tr></tbody></table><p>Data
ID 的命名 [...]
</span></span><span style=display:flex><span><span
style=color:#268bd2>key</span>: <span
style=color:#2aa198>"script-server"</span>
</span></span><span style=display:flex><span><span
style=color:#268bd2>enabled</span>: <span style=color:#cb4b16>true</span>
</span></span><span style=display:flex><span><span
style=color:#268bd2>type</span>: <span
style=color:#2aa198>"javascript"</span>
@@ -701,8 +707,12 @@
</span></span></span><span style=display:flex><span><span style=color:#2aa198>
return url && url.Port === "20000";
</span></span></span><span style=display:flex><span><span style=color:#2aa198>
});
</span></span></span><span style=display:flex><span><span style=color:#2aa198>
})(invokers, invocation, context);</span>
-</span></span></code></pre></div><p>参数说明:</p><table><thead><tr><th>参数</th><th>说明</th></tr></thead><tbody><tr><td>type</td><td>script的类型,目前仅可使用js</td></tr><tr><td>script</td><td>script实际内容</td></tr></tbody></table><div
id=pre-footer><h2>反馈</h2><p class=feedback--prompt>此页是否对您有帮助?</p><button
class="btn btn-primary mb-4 feedback--yes">是</button>
-<button class="btn btn-primary mb-4
feedback--no">否</button></div><script>const
yes=document.querySelector(".feedback--yes"),no=document.querySelector(".feedback--no");document.querySelectorAll(".feedback--link").forEach(e=>{e.href=e.href+window.location.pathname});const
sendFeedback=e=>{gtag||console.log("!gtag"),gtag("event","click",{event_category:"Helpful",event_label:window.location.pathname,value:e})},disableButtons=()=>{yes.disabled=!0,yes.classList.add("feedback--button__disabled
[...]
+</span></span></code></pre></div><p>字段说明:</p><table><thead><tr><th>字段</th><th>说明</th></tr></thead><tbody><tr><td><code>scope</code></td><td>Script
Router 使用 <code>application</code>
作用域。</td></tr><tr><td><code>key</code></td><td>规则目标 Provider
的应用名。</td></tr><tr><td><code>enabled</code></td><td>是否启用规则;设置为
<code>false</code> 时不执行脚本。</td></tr><tr><td><code>type</code></td><td>脚本类型,当前支持
<code>javascript</code>。</td></tr><tr><td><code>script</code></td><td>返回过滤后
Provider 列表的 JavaScript 脚本。</t [...]
+</span></span><span style=display:flex><span>go run
./go-node2-server/cmd/server_node2.go <span style=color:#586e75># 端口
20001</span>
+</span></span></code></pre></div><p>再启动 consumer:</p><div class=highlight><pre
tabindex=0
style=color:#93a1a1;background-color:#002b36;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code
class=language-bash data-lang=bash><span style=display:flex><span>go run
./go-client/cmd/client.go
+</span></span></code></pre></div><p>consumer 每 5 秒调用一次 <code>Greet</code>。未在
Nacos 下发规则时,响应会在 <code>20000</code> 和 <code>20001</code> 两个 Provider
之间切换。保存上述规则后无需重启 consumer,后续日志应只包含端口 <code>20000</code>:</p><div
class=highlight><pre tabindex=0
style=color:#93a1a1;background-color:#002b36;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code
class=language-text data-lang=text><span style=display:flex><span>receive:
hello world from: 20000
+</span></span></code></pre></div><p>删除 Nacos 配置或将 <code>enabled</code> 改为
<code>false</code> 后,调用会恢复为可路由到两个 Provider。若规则未生效,请检查 Data
ID、Group、配置中心连接以及脚本返回值。</p><h2 id=与-condition-router-的区别>与 Condition Router
的区别</h2><table><thead><tr><th>对比项</th><th>Script Router</th><th>Condition
Router</th></tr></thead><tbody><tr><td>规则表达</td><td>JavaScript
脚本</td><td>声明式条件表达式,例如 <code>consumer =>
provider</code></td></tr><tr><td>适用场景</td><td>自定义计算、复杂筛选或基于调用信息决策</td><td>地址、方法、应用名等常规匹配</td></tr><tr><td
[...]
+<button class="btn btn-primary mb-4
feedback--no">否</button></div><script>const
yes=document.querySelector(".feedback--yes"),no=document.querySelector(".feedback--no");document.querySelectorAll(".feedback--link").forEach(e=>{e.href=e.href+window.location.pathname});const
sendFeedback=e=>{gtag||console.log("!gtag"),gtag("event","click",{event_category:"Helpful",event_label:window.location.pathname,value:e})},disableButtons=()=>{yes.disabled=!0,yes.classList.add("feedback--button__disabled
[...]
<button class="contact-btn qr-container"
onmouseover='showQRCode("dingding-qr")'
onmouseout='hideQRCode("dingding-qr")'>钉钉<div class=qr-code id=dingding-qr
style=display:none><img
src=https://img.alicdn.com/imgextra/i4/O1CN01buuadT274Lj33QZWQ_!!6000000007743-0-tps-1170-1477.jpg
alt="DingTalk QR Code"></div></button>
<button class=contact-btn><a
href=https://github.com/apache/dubbo/>GitHub</a></button></div></div><div
class=footer-container-right><ul><li>文档</li><li><a
href=/zh-cn/overview/home/>概览</a></li><li><a
href=/zh-cn/overview/quickstart/>快速开始</a></li><li><a
href=/zh-cn/contact/contributor/software-donation-guide_dev/>开发者指南</a></li></ul><ul><li>资源</li><li><a
href=/zh-cn/contact/>社区</a></li></ul></div></div><div
style="width:85.125rem;height:0;border:1px solid
#dddee4;margin-bottom:32px"></div>< [...]
project logo are either registered trademarks or trademarks of The Apache
Software Foundation in the United States
diff --git a/zh-cn/sitemap.xml b/zh-cn/sitemap.xml
index e2183f60a8c..baee6540fea 100644
--- a/zh-cn/sitemap.xml
+++ b/zh-cn/sitemap.xml
@@ -1 +1 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes"?><urlset
xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
xmlns:xhtml="http://www.w3.org/1999/xhtml"><url><loc>https://dubbo.apache.org/zh-cn/blog/2023/01/16/%E9%98%BF%E9%87%8C%E5%B7%B4%E5%B7%B4%E5%8D%87%E7%BA%A7-dubbo3-%E5%85%A8%E9%9D%A2%E5%8F%96%E4%BB%A3-hsf2/</loc><lastmod>2023-11-28T15:14:12+08:00</lastmod><changefreq>monthly</changefreq><priority>0.5</priority><xhtml:link
rel="alternate" hreflang="en" href="https://dubbo.apach [...]
\ No newline at end of file
+<?xml version="1.0" encoding="utf-8" standalone="yes"?><urlset
xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
xmlns:xhtml="http://www.w3.org/1999/xhtml"><url><loc>https://dubbo.apache.org/zh-cn/blog/2023/01/16/%E9%98%BF%E9%87%8C%E5%B7%B4%E5%B7%B4%E5%8D%87%E7%BA%A7-dubbo3-%E5%85%A8%E9%9D%A2%E5%8F%96%E4%BB%A3-hsf2/</loc><lastmod>2023-11-28T15:14:12+08:00</lastmod><changefreq>monthly</changefreq><priority>0.5</priority><xhtml:link
rel="alternate" hreflang="en" href="https://dubbo.apach [...]
\ No newline at end of file