<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Traffic Control on Apache Dubbo</title><link>https://deploy-preview-3229--dubbo.netlify.app/en/overview/mannual/golang-sdk/tutorial/traffic/</link><description>Recent content in Traffic Control on Apache Dubbo</description><generator>Hugo</generator><language>en</language><atom:link href="https://deploy-preview-3229--dubbo.netlify.app/en/overview/mannual/golang-sdk/tutorial/traffic/index.xml" rel="self" type="application/rss+xml"/><item><title>Affinity Router</title><link>https://deploy-preview-3229--dubbo.netlify.app/en/overview/mannual/golang-sdk/tutorial/traffic/affinity_router/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://deploy-preview-3229--dubbo.netlify.app/en/overview/mannual/golang-sdk/tutorial/traffic/affinity_router/</guid><description/></item><item><title>Condition Router</title><link>https://deploy-preview-3229--dubbo.netlify.app/en/overview/mannual/golang-sdk/tutorial/traffic/condition_router/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://deploy-preview-3229--dubbo.netlify.app/en/overview/mannual/golang-sdk/tutorial/traffic/condition_router/</guid><description>&lt;p>Related samples:&lt;/p>
&lt;ul>
&lt;li>Dynamic condition router: &lt;a href="https://github.com/apache/dubbo-go-samples/tree/main/router/condition" target="_blank">dubbo-go-samples/router/condition&lt;/a>&lt;/li>
&lt;li>Static condition router: &lt;a href="https://github.com/apache/dubbo-go-samples/tree/main/router/static_config/condition" target="_blank">dubbo-go-samples/router/static_config/condition&lt;/a>&lt;/li>
&lt;/ul>
&lt;h2 id="how-to-use">How to use&lt;/h2>
&lt;h3 id="prerequisites">Prerequisites&lt;/h3>
&lt;ul>
&lt;li>Docker and Docker Compose environment to deploy Nacos registry.&lt;/li>
&lt;li>Nacos Version 2.x+&lt;/li>
&lt;li>Go 1.23+&lt;/li>
&lt;/ul>
&lt;h4 id="run-nacos">Run Nacos&lt;/h4>
&lt;p>Follow this instruction
to &lt;a href="https://dubbo-next.staged.apache.org/zh-cn/overview/reference/integrations/nacos/">install and start Nacos server&lt;/a>.&lt;/p>
&lt;h3 id="condition-router">Condition router&lt;/h3>
&lt;p>Similar to the Tag Router, the condition router offers more advanced traffic control capabilities.
It uses &lt;code>consumer =&amp;gt; provider&lt;/code> expressions to manage traffic for both providers and consumers.&lt;/p>
&lt;p>Expression example:&lt;/p>
&lt;p>&lt;code>host = 127.0.0.1 =&amp;gt; host = 127.0.0.1, 192.168.1.1&lt;/code>&lt;/p></description></item><item><title>Script Router</title><link>https://deploy-preview-3229--dubbo.netlify.app/en/overview/mannual/golang-sdk/tutorial/traffic/script_router/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://deploy-preview-3229--dubbo.netlify.app/en/overview/mannual/golang-sdk/tutorial/traffic/script_router/</guid><description>&lt;p>Sample source: &lt;a href="https://github.com/apache/dubbo-go-samples/tree/main/router/script" target="_blank">dubbo-go-samples/router/script&lt;/a>.&lt;/p>
&lt;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.&lt;/p>
&lt;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.&lt;/p></description></item><item><title>Tag Router</title><link>https://deploy-preview-3229--dubbo.netlify.app/en/overview/mannual/golang-sdk/tutorial/traffic/tag_router/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://deploy-preview-3229--dubbo.netlify.app/en/overview/mannual/golang-sdk/tutorial/traffic/tag_router/</guid><description>&lt;p>Related samples:&lt;/p>
&lt;ul>
&lt;li>Dynamic tag router: &lt;a href="https://github.com/apache/dubbo-go-samples/tree/main/router/tag" target="_blank">dubbo-go-samples/router/tag&lt;/a>&lt;/li>
&lt;li>Static tag router: &lt;a href="https://github.com/apache/dubbo-go-samples/tree/main/router/static_config/tag" target="_blank">dubbo-go-samples/router/static_config/tag&lt;/a>&lt;/li>
&lt;/ul>
&lt;h2 id="how-to-use">How to use&lt;/h2>
&lt;h3 id="prerequisites">Prerequisites&lt;/h3>
&lt;ul>
&lt;li>Docker and Docker Compose environment to deploy Nacos registry.&lt;/li>
&lt;li>Nacos Version 2.x+&lt;/li>
&lt;li>Go 1.23+&lt;/li>
&lt;/ul>
&lt;h4 id="run-nacos">Run Nacos&lt;/h4>
&lt;p>Follow this instruction
to &lt;a href="https://dubbo-next.staged.apache.org/zh-cn/overview/reference/integrations/nacos/">install and start Nacos server&lt;/a>.&lt;/p>
&lt;h3 id="tag-router">Tag router&lt;/h3>
&lt;p>The tag router enables traffic control based on tags. It is commonly used for canary releases (tag the new-version instances so that only requests carrying the tag are routed to them) and environment isolation (instances in different lanes are distinguished by tags to keep traffic from crossing environments). The following is the example code.&lt;/p></description></item><item><title>Sentinel Rate Limiting and Downgrade</title><link>https://deploy-preview-3229--dubbo.netlify.app/en/overview/mannual/golang-sdk/tutorial/traffic/sentinel/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://deploy-preview-3229--dubbo.netlify.app/en/overview/mannual/golang-sdk/tutorial/traffic/sentinel/</guid><description>&lt;p>Dubbo-go provides a built-in rate limiting component, allowing users to adjust rate limiting values and post-limiting behaviors according to their business scenarios. The specifics can be defined and implemented in &lt;a href="https://github.com/apache/dubbo-go/blob/main/filter/tps_limiter.go#L52">TpsLimiter&lt;/a>. Users can set a simple rate limiting strategy on the server side in a manner similar to the following:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#93a1a1;background-color:#002b36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-go" data-lang="go">&lt;span style="display:flex;">&lt;span>server.&lt;span style="color:#268bd2">WithTpsLimiter&lt;/span>(&lt;span style="color:#2aa198">&amp;#34;method-service&amp;#34;&lt;/span>) &lt;span style="color:#586e75">// Currently supports implementations like method-service, polaris, etc.
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#586e75">&lt;/span>server.&lt;span style="color:#268bd2">WithTpsLimiterXxx&lt;/span>() &lt;span style="color:#586e75">// Set rate limiting related thresholds, please fill in according to the specific method
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#586e75">//tps.limit.strategy: &amp;#34;slidingWindow&amp;#34;
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#586e75">//tps.limit.rejected.handler: &amp;#34;default&amp;#34;
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#586e75">//tps.limit.interval: 1000
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#586e75">//tps.limit.rate: 3
&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>The built-in rate limiting strategy in Dubbo-go is relatively simple. For more complex scenarios, we recommend using professional third-party frameworks like Sentinel to achieve richer and more flexible rate limiting strategies.&lt;/p></description></item></channel></rss>