<?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-3199--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-3199--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-3199--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-3199--dubbo.netlify.app/en/overview/mannual/golang-sdk/tutorial/traffic/affinity_router/</guid><description/></item><item><title>Condition Router</title><link>https://deploy-preview-3199--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-3199--dubbo.netlify.app/en/overview/mannual/golang-sdk/tutorial/traffic/condition_router/</guid><description>&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>
&lt;blockquote>
&lt;p>You can use = and != symbols for matching, and use commas for multiple choice matching.&lt;/p></description></item><item><title>Script Router</title><link>https://deploy-preview-3199--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-3199--dubbo.netlify.app/en/overview/mannual/golang-sdk/tutorial/traffic/script_router/</guid><description>&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="script-router">Script router&lt;/h3>
&lt;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.&lt;/p>
&lt;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.&lt;/p></description></item><item><title>Tag Router</title><link>https://deploy-preview-3199--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-3199--dubbo.netlify.app/en/overview/mannual/golang-sdk/tutorial/traffic/tag_router/</guid><description>&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. The following is the example code.&lt;/p>
&lt;p>Server side:&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>ins, err &lt;span style="color:#719e07">:=&lt;/span> dubbo.&lt;span style="color:#268bd2">NewInstance&lt;/span>(
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>		dubbo.&lt;span style="color:#268bd2">WithName&lt;/span>(&lt;span style="color:#2aa198">&amp;#34;tag-server&amp;#34;&lt;/span>),
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>		dubbo.&lt;span style="color:#268bd2">WithTag&lt;/span>(&lt;span style="color:#2aa198">&amp;#34;test-Tag&amp;#34;&lt;/span>), &lt;span style="color:#586e75">// set application&amp;#39;s tag
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#586e75">&lt;/span>		dubbo.&lt;span style="color:#268bd2">WithRegistry&lt;/span>(
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>			registry.&lt;span style="color:#268bd2">WithNacos&lt;/span>(),
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>			registry.&lt;span style="color:#268bd2">WithAddress&lt;/span>(RegistryAddress),
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>		),
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>		dubbo.&lt;span style="color:#268bd2">WithProtocol&lt;/span>(
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>			protocol.&lt;span style="color:#268bd2">WithTriple&lt;/span>(),
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>			protocol.&lt;span style="color:#268bd2">WithPort&lt;/span>(&lt;span style="color:#2aa198">20000&lt;/span>),
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>		),
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>	)
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>Parameters:&lt;/p></description></item><item><title>Sentinel Rate Limiting and Downgrade</title><link>https://deploy-preview-3199--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-3199--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>