<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Address Discovery on Apache Dubbo</title><link>https://deploy-preview-3199--dubbo.netlify.app/en/overview/mannual/golang-sdk/tutorial/service-discovery/</link><description>Recent content in Address Discovery 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/service-discovery/index.xml" rel="self" type="application/rss+xml"/><item><title>Using Nacos as the Registry</title><link>https://deploy-preview-3199--dubbo.netlify.app/en/overview/mannual/golang-sdk/tutorial/service-discovery/nacos/</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/service-discovery/nacos/</guid><description>&lt;p>This example shows dubbo-go&amp;rsquo;s service discovery feature with Nacos as the registry.&lt;/p>
&lt;h2 id="usage">Usage&lt;/h2>
&lt;p>Specify the registry address in the following way:&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, _ &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;dubbo_registry_nacos_server&amp;#34;&lt;/span>),
&lt;/span>&lt;/span>&lt;span style="display:flex;">&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>(&lt;span style="color:#2aa198">&amp;#34;127.0.0.1:8848&amp;#34;&lt;/span>),
&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;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>srv, err &lt;span style="color:#719e07">:=&lt;/span> ins.&lt;span style="color:#268bd2">NewServer&lt;/span>()
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h2 id="how-to-run">How to run&lt;/h2>
&lt;h3 id="start-nacos-server">Start Nacos server&lt;/h3>
&lt;p>Follow this instruction to &lt;a href="https://deploy-preview-3199--dubbo.netlify.app/en/overview/reference/integrations/nacos/">install and start Nacos server&lt;/a>.&lt;/p>
&lt;h3 id="run-server">Run server&lt;/h3>
&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-shell" data-lang="shell">&lt;span style="display:flex;">&lt;span>$ go run ./go-server/cmd/server.go
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>Test if the RPC server works as expected:&lt;/p></description></item><item><title>Using Zookeeper as a registry</title><link>https://deploy-preview-3199--dubbo.netlify.app/en/overview/mannual/golang-sdk/tutorial/service-discovery/zookeeper/</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/service-discovery/zookeeper/</guid><description>&lt;p>This example shows dubbo-go&amp;rsquo;s service discovery feature with Zookeeper as registry.&lt;/p>
&lt;h2 id="usage">Usage&lt;/h2>
&lt;p>Specify the registry address as follows:&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, _ &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;dubbo_registry_nacos_server&amp;#34;&lt;/span>),
&lt;/span>&lt;/span>&lt;span style="display:flex;">&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">WithZookeeper&lt;/span>(),
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>		registry.&lt;span style="color:#268bd2">WithAddress&lt;/span>(&lt;span style="color:#2aa198">&amp;#34;127.0.0.1:2181&amp;#34;&lt;/span>),
&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;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>srv, err &lt;span style="color:#719e07">:=&lt;/span> ins.&lt;span style="color:#268bd2">NewServer&lt;/span>()
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h2 id="how-to-run">How to run&lt;/h2>
&lt;h3 id="start-zookeeper-server">Start Zookeeper server&lt;/h3>
&lt;p>This example relies on Zookeeper as the registry; follow the steps below to start a Zookeeper server first.&lt;/p>
&lt;ol>
&lt;li>Start Zookeeper with Docker, run &lt;code>docker run --rm -p 2181:2181 zookeeper&lt;/code> or &lt;code>make -f $DUBBO_GO_SAMPLES_ROOT_PATH/build/Makefile docker-up&lt;/code>.&lt;/li>
&lt;li>&lt;a href="https://zookeeper.apache.org/releases.html#download">Download and start Zookeeper&lt;/a> locally on your machine.&lt;/li>
&lt;/ol>
&lt;h3 id="run-server">Run server&lt;/h3>
&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-shell" data-lang="shell">&lt;span style="display:flex;">&lt;span>$ go run ./go-server/cmd/server.go
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>Test RPC server works as expected:&lt;/p></description></item><item><title>Multiple Registration Centers</title><link>https://deploy-preview-3199--dubbo.netlify.app/en/overview/mannual/golang-sdk/tutorial/service-discovery/multi_registry/</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/service-discovery/multi_registry/</guid><description>&lt;p>A Dubbo application can configure multiple registration centers at different interface dimensions. Multiple registration centers can be used for cluster isolation, migration, and various other scenarios. For a more detailed explanation, refer to the &lt;a href="https://dubbo.apache.org/zh-cn/overview/mannual/java-sdk/reference-manual/registry/multiple-registry/" target="_blank">Dubbo Java Multiple Registration Center Documentation&lt;/a>.&lt;/p>
&lt;h2 id="api-configuration-method">API Configuration Method&lt;/h2>
&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, _ &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">WithRegistry&lt;/span>(
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>	 &lt;span style="color:#268bd2">registryWithID&lt;/span>(&lt;span style="color:#2aa198">&amp;#34;nacos&amp;#34;&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>(&lt;span style="color:#2aa198">&amp;#34;127.0.0.1:8848&amp;#34;&lt;/span>),
&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">WithRegistry&lt;/span>(
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>	 &lt;span style="color:#268bd2">registryWithID&lt;/span>(&lt;span style="color:#2aa198">&amp;#34;zookeeper&amp;#34;&lt;/span>),
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>		registry.&lt;span style="color:#268bd2">WithZookeeper&lt;/span>(),
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>		registry.&lt;span style="color:#268bd2">WithAddress&lt;/span>(&lt;span style="color:#2aa198">&amp;#34;127.0.0.1:2181&amp;#34;&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>Specify which registration center a service under a specific server should register to:&lt;/p></description></item></channel></rss>