<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Source Code Guide on Apache Dubbo</title><link>https://deploy-preview-3229--dubbo.netlify.app/en/overview/mannual/golang-sdk/sourcecode/</link><description>Recent content in Source Code Guide 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/sourcecode/index.xml" rel="self" type="application/rss+xml"/><item><title>Architecture</title><link>https://deploy-preview-3229--dubbo.netlify.app/en/overview/mannual/golang-sdk/sourcecode/architecture/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://deploy-preview-3229--dubbo.netlify.app/en/overview/mannual/golang-sdk/sourcecode/architecture/</guid><description>&lt;p>Related samples:&lt;/p>
&lt;ul>
&lt;li>Quick start RPC application: &lt;a href="https://github.com/apache/dubbo-go-samples/tree/main/helloworld" target="_blank">dubbo-go-samples/helloworld&lt;/a>&lt;/li>
&lt;li>Registry-based microservice application: &lt;a href="https://github.com/apache/dubbo-go-samples/tree/main/registry/nacos" target="_blank">dubbo-go-samples/registry/nacos&lt;/a>&lt;/li>
&lt;li>Multi-protocol application: &lt;a href="https://github.com/apache/dubbo-go-samples/tree/main/rpc/multi-protocols" target="_blank">dubbo-go-samples/rpc/multi-protocols&lt;/a>&lt;/li>
&lt;/ul>
&lt;p>Dubbo Go is organized around a small set of runtime concepts: an application instance, providers, consumers, protocols, registries, metadata, and governance extensions. Current applications are usually built with the API entry points in &lt;code>dubbo.go&lt;/code>, &lt;code>server&lt;/code>, and &lt;code>client&lt;/code>, while configuration-file users still go through &lt;code>config.RootConfig&lt;/code>.&lt;/p>
&lt;h2 id="main-runtime-layers">Main Runtime Layers&lt;/h2>
&lt;table>
 &lt;thead>
 &lt;tr>
 &lt;th style="text-align: left">Layer&lt;/th>
 &lt;th style="text-align: left">Important packages&lt;/th>
 &lt;th style="text-align: left">Responsibility&lt;/th>
 &lt;/tr>
 &lt;/thead>
 &lt;tbody>
 &lt;tr>
 &lt;td style="text-align: left">Application instance&lt;/td>
 &lt;td style="text-align: left">&lt;code>dubbo.go&lt;/code>, &lt;code>options.go&lt;/code>&lt;/td>
 &lt;td style="text-align: left">Holds application, protocol, registry, metadata, metrics, tracing, router, and shutdown options.&lt;/td>
 &lt;/tr>
 &lt;tr>
 &lt;td style="text-align: left">Provider API&lt;/td>
 &lt;td style="text-align: left">&lt;code>server&lt;/code>&lt;/td>
 &lt;td style="text-align: left">Registers service handlers, builds service options, creates invokers, and exports services.&lt;/td>
 &lt;/tr>
 &lt;tr>
 &lt;td style="text-align: left">Consumer API&lt;/td>
 &lt;td style="text-align: left">&lt;code>client&lt;/code>&lt;/td>
 &lt;td style="text-align: left">Creates clients, dials service references, creates generated or generic services, and invokes remote methods.&lt;/td>
 &lt;/tr>
 &lt;tr>
 &lt;td style="text-align: left">Protocol&lt;/td>
 &lt;td style="text-align: left">&lt;code>protocol/base&lt;/code>, &lt;code>protocol/triple&lt;/code>, &lt;code>protocol/dubbo&lt;/code>, &lt;code>protocol/rest&lt;/code>&lt;/td>
 &lt;td style="text-align: left">Converts invokers into network servers on provider side and network clients on consumer side.&lt;/td>
 &lt;/tr>
 &lt;tr>
 &lt;td style="text-align: left">Registry and discovery&lt;/td>
 &lt;td style="text-align: left">&lt;code>registry&lt;/code>, &lt;code>registry/protocol&lt;/code>, &lt;code>registry/servicediscovery&lt;/code>, &lt;code>registry/directory&lt;/code>&lt;/td>
 &lt;td style="text-align: left">Handles registration, subscription, service discovery, and registry-backed invocation.&lt;/td>
 &lt;/tr>
 &lt;tr>
 &lt;td style="text-align: left">Metadata&lt;/td>
 &lt;td style="text-align: left">&lt;code>metadata&lt;/code>, &lt;code>metadata/report&lt;/code>, &lt;code>metadata/mapping&lt;/code>&lt;/td>
 &lt;td style="text-align: left">Stores service definitions, service-to-application mapping, and metadata reports.&lt;/td>
 &lt;/tr>
 &lt;tr>
 &lt;td style="text-align: left">Governance extensions&lt;/td>
 &lt;td style="text-align: left">&lt;code>filter&lt;/code>, &lt;code>cluster&lt;/code>, &lt;code>cluster/router&lt;/code>, &lt;code>cluster/loadbalance&lt;/code>, &lt;code>common/extension&lt;/code>&lt;/td>
 &lt;td style="text-align: left">Provides filters, routing, load balancing, cluster strategies, and extension registration.&lt;/td>
 &lt;/tr>
 &lt;/tbody>
&lt;/table>
&lt;h2 id="provider-flow">Provider Flow&lt;/h2>
&lt;p>For the current server API, a provider normally follows this path:&lt;/p></description></item><item><title>Network Protocol</title><link>https://deploy-preview-3229--dubbo.netlify.app/en/overview/mannual/golang-sdk/sourcecode/protocol/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://deploy-preview-3229--dubbo.netlify.app/en/overview/mannual/golang-sdk/sourcecode/protocol/</guid><description>&lt;p>Related samples:&lt;/p>
&lt;ul>
&lt;li>Triple RPC: &lt;a href="https://github.com/apache/dubbo-go-samples/tree/main/rpc/triple" target="_blank">dubbo-go-samples/rpc/triple&lt;/a>&lt;/li>
&lt;li>Multi-protocol service: &lt;a href="https://github.com/apache/dubbo-go-samples/tree/main/rpc/multi-protocols" target="_blank">dubbo-go-samples/rpc/multi-protocols&lt;/a>&lt;/li>
&lt;li>gRPC interoperability: &lt;a href="https://github.com/apache/dubbo-go-samples/tree/main/rpc/grpc" target="_blank">dubbo-go-samples/rpc/grpc&lt;/a>&lt;/li>
&lt;/ul>
&lt;p>In current Dubbo Go, the protocol layer is the bridge between the invocation model and the wire protocol. It is responsible for exposing providers as network services and turning consumer-side references into callable remote invokers.&lt;/p>
&lt;h2 id="core-protocol-abstraction">Core Protocol Abstraction&lt;/h2>
&lt;p>The current protocol interface is defined in &lt;code>protocol/base/base_protocol.go&lt;/code>:&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>&lt;span style="color:#268bd2">type&lt;/span> Protocol &lt;span style="color:#268bd2">interface&lt;/span> {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>	&lt;span style="color:#268bd2">Export&lt;/span>(invoker Invoker) Exporter
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>	&lt;span style="color:#268bd2">Refer&lt;/span>(url &lt;span style="color:#719e07">*&lt;/span>common.URL) Invoker
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>	&lt;span style="color:#268bd2">Destroy&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>Its responsibilities are straightforward:&lt;/p>
&lt;ul>
&lt;li>&lt;code>Export&lt;/code>: expose a provider-side invoker as a network service&lt;/li>
&lt;li>&lt;code>Refer&lt;/code>: create a consumer-side invoker for a target URL&lt;/li>
&lt;li>&lt;code>Destroy&lt;/code>: destroy protocol-owned invokers and exporters&lt;/li>
&lt;/ul>
&lt;p>There is also an optional capability:&lt;/p></description></item><item><title>Registry</title><link>https://deploy-preview-3229--dubbo.netlify.app/en/overview/mannual/golang-sdk/sourcecode/registry/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://deploy-preview-3229--dubbo.netlify.app/en/overview/mannual/golang-sdk/sourcecode/registry/</guid><description>&lt;p>Related samples:&lt;/p>
&lt;ul>
&lt;li>Nacos registry: &lt;a href="https://github.com/apache/dubbo-go-samples/tree/main/registry/nacos" target="_blank">dubbo-go-samples/registry/nacos&lt;/a>&lt;/li>
&lt;li>Zookeeper registry: &lt;a href="https://github.com/apache/dubbo-go-samples/tree/main/registry/zookeeper" target="_blank">dubbo-go-samples/registry/zookeeper&lt;/a>&lt;/li>
&lt;li>Application-level service discovery: &lt;a href="https://github.com/apache/dubbo-go-samples/tree/main/registry/nacos" target="_blank">dubbo-go-samples/registry/nacos&lt;/a>&lt;/li>
&lt;/ul>
&lt;p>Related documentation:&lt;/p>
&lt;ul>
&lt;li>&lt;a href="https://deploy-preview-3229--dubbo.netlify.app/en/overview/mannual/golang-sdk/tutorial/service-discovery/application-level-service-discovery/">Application-level Service Discovery&lt;/a>&lt;/li>
&lt;/ul>
&lt;p>In current Dubbo Go, the registry layer is not only about interface-level address registration. It also participates in application-level service discovery, metadata bootstrap, subscription refresh, and registry-backed protocol export.&lt;/p>
&lt;h2 id="core-registry-interface">Core Registry Interface&lt;/h2>
&lt;p>The main interface is defined in &lt;code>registry/registry.go&lt;/code>:&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>&lt;span style="color:#268bd2">type&lt;/span> Registry &lt;span style="color:#268bd2">interface&lt;/span> {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>	common.Node
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>	&lt;span style="color:#268bd2">Register&lt;/span>(url &lt;span style="color:#719e07">*&lt;/span>common.URL) &lt;span style="color:#dc322f">error&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>	&lt;span style="color:#268bd2">UnRegister&lt;/span>(url &lt;span style="color:#719e07">*&lt;/span>common.URL) &lt;span style="color:#dc322f">error&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>	&lt;span style="color:#268bd2">Subscribe&lt;/span>(&lt;span style="color:#719e07">*&lt;/span>common.URL, NotifyListener) &lt;span style="color:#dc322f">error&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>	&lt;span style="color:#268bd2">UnSubscribe&lt;/span>(&lt;span style="color:#719e07">*&lt;/span>common.URL, NotifyListener) &lt;span style="color:#dc322f">error&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>	&lt;span style="color:#268bd2">LoadSubscribeInstances&lt;/span>(&lt;span style="color:#719e07">*&lt;/span>common.URL, NotifyListener) &lt;span style="color:#dc322f">error&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>Compared with older explanations, &lt;code>LoadSubscribeInstances(...)&lt;/code> is now part of the contract. It exists because subscription is asynchronous, and Dubbo Go may need an initial synchronous load before the normal subscription stream catches up.&lt;/p></description></item><item><title>Core 3.x Capabilities</title><link>https://deploy-preview-3229--dubbo.netlify.app/en/overview/mannual/golang-sdk/sourcecode/3.0_feature/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://deploy-preview-3229--dubbo.netlify.app/en/overview/mannual/golang-sdk/sourcecode/3.0_feature/</guid><description>&lt;p>Related samples:&lt;/p>
&lt;ul>
&lt;li>Triple protocol: &lt;a href="https://github.com/apache/dubbo-go-samples/tree/main/rpc/triple" target="_blank">dubbo-go-samples/rpc/triple&lt;/a>&lt;/li>
&lt;li>Application-level discovery with Nacos: &lt;a href="https://github.com/apache/dubbo-go-samples/tree/main/registry/nacos" target="_blank">dubbo-go-samples/registry/nacos&lt;/a>&lt;/li>
&lt;li>Service Mesh deployment: &lt;a href="https://github.com/apache/dubbo-go-samples/tree/main/mesh" target="_blank">dubbo-go-samples/mesh&lt;/a>&lt;/li>
&lt;/ul>
&lt;p>Dubbo Go 3.x is centered on the Triple protocol, application-level service discovery, metadata-driven service introspection, and SDK-side governance capabilities. These capabilities are no longer just &amp;ldquo;new features&amp;rdquo; from the 3.0 release; they are the normal development model for current Dubbo Go applications.&lt;/p>
&lt;h2 id="triple-protocol">Triple Protocol&lt;/h2>
&lt;p>Triple is the recommended RPC protocol in Dubbo Go 3.x. Its implementation lives mainly under:&lt;/p></description></item><item><title>Generic Call</title><link>https://deploy-preview-3229--dubbo.netlify.app/en/overview/mannual/golang-sdk/sourcecode/generic/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://deploy-preview-3229--dubbo.netlify.app/en/overview/mannual/golang-sdk/sourcecode/generic/</guid><description>&lt;p>Related samples:&lt;/p>
&lt;ul>
&lt;li>Generic invocation sample: &lt;a href="https://github.com/apache/dubbo-go-samples/tree/main/generic" target="_blank">dubbo-go-samples/generic&lt;/a>&lt;/li>
&lt;li>Triple sample: &lt;a href="https://github.com/apache/dubbo-go-samples/tree/main/rpc/triple" target="_blank">dubbo-go-samples/rpc/triple&lt;/a>&lt;/li>
&lt;/ul>
&lt;p>Generic invocation in current Dubbo Go is centered on &lt;code>client.NewGenericService(...)&lt;/code> and &lt;code>filter/generic.GenericService&lt;/code>. Older examples based on &lt;code>ReferenceConfigBuilder&lt;/code>, &lt;code>GenericLoad()&lt;/code>, and &lt;code>GetRPCService()&lt;/code> describe the legacy compatibility API and are no longer the recommended entry point.&lt;/p>
&lt;h2 id="core-api">Core API&lt;/h2>
&lt;p>The main runtime entry is in &lt;code>client/client.go&lt;/code>:&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>genericService, err &lt;span style="color:#719e07">:=&lt;/span> cli.&lt;span style="color:#268bd2">NewGenericService&lt;/span>(
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>	&lt;span style="color:#2aa198">&amp;#34;org.apache.dubbo.samples.UserProvider&amp;#34;&lt;/span>,
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>	client.&lt;span style="color:#268bd2">WithProtocolTriple&lt;/span>(),
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>	client.&lt;span style="color:#268bd2">WithSerialization&lt;/span>(constant.Hessian2Serialization),
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>	client.&lt;span style="color:#268bd2">WithURL&lt;/span>(&lt;span style="color:#2aa198">&amp;#34;tri://127.0.0.1:20000&amp;#34;&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>&lt;code>NewGenericService(...)&lt;/code> does three important things by default:&lt;/p>
&lt;ul>
&lt;li>sets &lt;code>NONIDL&lt;/code>&lt;/li>
&lt;li>enables generic invocation&lt;/li>
&lt;li>uses &lt;code>hessian2&lt;/code> serialization&lt;/li>
&lt;/ul>
&lt;p>Internally it creates &lt;code>filter/generic.GenericService&lt;/code>, then wires it into the normal reference and invocation path.&lt;/p></description></item><item><title>Generic Invocation Compatibility Notes</title><link>https://deploy-preview-3229--dubbo.netlify.app/en/overview/mannual/golang-sdk/sourcecode/generic-2/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://deploy-preview-3229--dubbo.netlify.app/en/overview/mannual/golang-sdk/sourcecode/generic-2/</guid><description>&lt;p>Related sample:&lt;/p>
&lt;ul>
&lt;li>Generic invocation sample: &lt;a href="https://github.com/apache/dubbo-go-samples/tree/main/generic" target="_blank">dubbo-go-samples/generic&lt;/a>&lt;/li>
&lt;/ul>
&lt;p>This page is kept mainly for compatibility with older links.&lt;/p>
&lt;p>For current Dubbo Go, please read &lt;a href="https://deploy-preview-3229--dubbo.netlify.app/en/overview/mannual/golang-sdk/sourcecode/generic/">Generic Call&lt;/a>. The old examples that use:&lt;/p>
&lt;ul>
&lt;li>&lt;code>config.NewReferenceConfigBuilder()&lt;/code>&lt;/li>
&lt;li>&lt;code>GenericLoad()&lt;/code>&lt;/li>
&lt;li>&lt;code>GetRPCService()&lt;/code>&lt;/li>
&lt;/ul>
&lt;p>describe the legacy configuration-centric API path. The recommended runtime entry today is:&lt;/p>
&lt;ul>
&lt;li>&lt;code>client.NewGenericService(...)&lt;/code>&lt;/li>
&lt;li>&lt;code>filter/generic.GenericService.Invoke(...)&lt;/code>&lt;/li>
&lt;li>&lt;code>filter/generic.GenericService.InvokeWithType(...)&lt;/code>&lt;/li>
&lt;/ul>
&lt;p>If you need a working example, use the &lt;code>dubbo-go-samples/generic&lt;/code> sample first.&lt;/p></description></item><item><title>AOP and Extension Mechanism</title><link>https://deploy-preview-3229--dubbo.netlify.app/en/overview/mannual/golang-sdk/sourcecode/aop_and_extension/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://deploy-preview-3229--dubbo.netlify.app/en/overview/mannual/golang-sdk/sourcecode/aop_and_extension/</guid><description>&lt;p>Related samples:&lt;/p>
&lt;ul>
&lt;li>Custom filter: &lt;a href="https://github.com/apache/dubbo-go-samples/tree/main/filter/custom" target="_blank">dubbo-go-samples/filter/custom&lt;/a>&lt;/li>
&lt;li>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>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;/ul>
&lt;p>Dubbo Go uses Go package initialization plus a centralized extension registry to provide most pluggable capabilities. Filters, routers, protocols, registries, load balancers, cluster strategies, tracing exporters, and metadata reporters are all loaded in this way.&lt;/p>
&lt;h2 id="extension-registry">Extension Registry&lt;/h2>
&lt;p>The current implementation lives under &lt;code>common/extension&lt;/code>. It no longer relies on ad hoc package-level maps for each type. Instead, each extension category uses the shared generic registry helper:&lt;/p></description></item><item><title>Application and Interface</title><link>https://deploy-preview-3229--dubbo.netlify.app/en/overview/mannual/golang-sdk/sourcecode/app_and_interface/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://deploy-preview-3229--dubbo.netlify.app/en/overview/mannual/golang-sdk/sourcecode/app_and_interface/</guid><description>&lt;p>Related samples:&lt;/p>
&lt;ul>
&lt;li>Hello world application: &lt;a href="https://github.com/apache/dubbo-go-samples/tree/main/helloworld" target="_blank">dubbo-go-samples/helloworld&lt;/a>&lt;/li>
&lt;li>YAML-based configuration: &lt;a href="https://github.com/apache/dubbo-go-samples/tree/main/config_yaml" target="_blank">dubbo-go-samples/config_yaml&lt;/a>&lt;/li>
&lt;li>Registry-based application: &lt;a href="https://github.com/apache/dubbo-go-samples/tree/main/registry/nacos" target="_blank">dubbo-go-samples/registry/nacos&lt;/a>&lt;/li>
&lt;/ul>
&lt;p>Current Dubbo Go still separates concepts into application-level configuration and interface-level service references, but the runtime model is broader than the older &amp;ldquo;application vs interface&amp;rdquo; explanation. The real source of truth is now the application instance options in &lt;code>options.go&lt;/code> and the compatibility configuration model in &lt;code>config/root_config.go&lt;/code>.&lt;/p>
&lt;h2 id="application-level-configuration">Application-Level Configuration&lt;/h2>
&lt;p>Application-level configuration is shared by all services and references inside one Dubbo Go process.&lt;/p></description></item></channel></rss>