You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dubbo.apache.org by al...@apache.org on 2026/06/23 02:09:38 UTC
(dubbo-website) branch master updated: docs: update all golang docs (#3213)
This is an automated email from the ASF dual-hosted git repository.
AlexStocks pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/dubbo-website.git
The following commit(s) were added to refs/heads/master by this push:
new 1f46aa33e57 docs: update all golang docs (#3213)
1f46aa33e57 is described below
commit 1f46aa33e570bb29b74ca11e38a7b09b7600c984
Author: Xuetao Li <m1...@163.com>
AuthorDate: Tue Jun 23 02:09:33 2026 +0000
docs: update all golang docs (#3213)
* update all docs
* fix golang sdk doc review comments
---
.../en/overview/mannual/golang-sdk/introduction.md | 7 +-
.../mannual/golang-sdk/quickstart/microservices.md | 3 +-
.../overview/mannual/golang-sdk/quickstart/rpc.md | 19 +-
.../en/overview/mannual/golang-sdk/refer/_index.md | 13 +-
.../overview/mannual/golang-sdk/refer/ecology.md | 88 +++---
.../overview/mannual/golang-sdk/refer/generic.md | 315 ++++-----------------
.../en/overview/mannual/golang-sdk/refer/nacos.md | 196 +++++--------
.../golang-sdk/refer/sourcecode/3.0_feature.md | 81 ------
.../mannual/golang-sdk/refer/sourcecode/_index.md | 11 -
.../refer/sourcecode/aop_and_extension.md | 111 --------
.../refer/sourcecode/app_and_interface.md | 75 -----
.../golang-sdk/refer/sourcecode/architecture.md | 32 ---
.../golang-sdk/refer/sourcecode/generic-2.md | 112 --------
.../mannual/golang-sdk/refer/sourcecode/generic.md | 108 -------
.../golang-sdk/refer/sourcecode/protocol.md | 34 ---
.../golang-sdk/refer/sourcecode/registry.md | 60 ----
.../mannual/golang-sdk/sourcecode/3.0_feature.md | 75 +++++
.../mannual/golang-sdk/sourcecode/_index.md | 14 +
.../golang-sdk/sourcecode/aop_and_extension.md | 114 ++++++++
.../golang-sdk/sourcecode/app_and_interface.md | 105 +++++++
.../mannual/golang-sdk/sourcecode/architecture.md | 65 +++++
.../mannual/golang-sdk/sourcecode/generic-2.md | 29 ++
.../mannual/golang-sdk/sourcecode/generic.md | 90 ++++++
.../mannual/golang-sdk/sourcecode/protocol.md | 105 +++++++
.../mannual/golang-sdk/sourcecode/registry.md | 111 ++++++++
.../en/overview/mannual/golang-sdk/tools/_index.md | 8 +
.../use_dubbogo_cli.md => tools/dubbogo-cli.md} | 40 ++-
.../tutorial/{deploy2 => deployment}/_index.md | 3 +-
.../tutorial/{deploy2 => deployment}/deploy.md | 14 +-
.../{deploy2 => deployment}/graceful_shutdown.md | 4 +-
.../tutorial/{deploy2 => deployment}/istio.md | 1 +
.../proxyless_service_mesh.md | 13 +-
.../{deploy2 => deployment}/traffic_management.md | 14 +-
.../golang-sdk/tutorial/interoperability/_index.md | 6 +
.../dubbo-java}/_index.md | 4 +-
.../call_java_protocol_dubbo_non_protobuf.md | 1 +
.../call_java_protocol_triple_protobuf.md | 1 +
.../dubbo-java}/service-discovery.md | 2 +
.../grpc}/_index.md | 4 +-
.../grpc}/call_grpc.md | 1 +
.../golang-sdk/tutorial/observability/probe.md | 2 +-
.../golang-sdk/tutorial/observability/tracing.md | 3 +-
.../mannual/golang-sdk/tutorial/rpc/attachments.md | 218 ++++++++++++--
.../mannual/golang-sdk/tutorial/rpc/filter.md | 99 +++++--
.../mannual/golang-sdk/tutorial/rpc/openapi.md | 3 +-
.../mannual/golang-sdk/tutorial/rpc/protocol.md | 6 +-
.../mannual/golang-sdk/tutorial/rpc/streaming.md | 45 ++-
.../application-level-service-discovery.md | 150 ++++++++++
.../golang-sdk/tutorial/service-discovery/nacos.md | 4 +-
.../tutorial/service-discovery/zookeeper.md | 5 +-
.../tutorial/traffic/condition_router.md | 5 +
.../golang-sdk/tutorial/traffic/script_router.md | 5 +-
.../golang-sdk/tutorial/traffic/tag_router.md | 5 +
content/en/overview/mannual/golang-sdk/versions.md | 35 ++-
.../overview/what/core-features/extensibility.md | 4 +-
.../en/overview/what/core-features/protocols.md | 2 +-
.../what/core-features/service-discovery.md | 2 +-
.../overview/mannual/golang-sdk/introduction.md | 7 +-
.../mannual/golang-sdk/quickstart/microservices.md | 3 +-
.../overview/mannual/golang-sdk/quickstart/rpc.md | 21 +-
.../overview/mannual/golang-sdk/refer/_index.md | 14 +-
.../overview/mannual/golang-sdk/refer/ecology.md | 89 +++---
.../overview/mannual/golang-sdk/refer/generic.md | 313 ++++----------------
.../overview/mannual/golang-sdk/refer/nacos.md | 197 +++++--------
.../golang-sdk/refer/sourcecode/3.0_feature.md | 80 ------
.../mannual/golang-sdk/refer/sourcecode/_index.md | 10 -
.../refer/sourcecode/aop_and_extension.md | 111 --------
.../refer/sourcecode/app_and_interface.md | 74 -----
.../golang-sdk/refer/sourcecode/architecture.md | 31 --
.../golang-sdk/refer/sourcecode/generic-2.md | 112 --------
.../mannual/golang-sdk/refer/sourcecode/generic.md | 107 -------
.../golang-sdk/refer/sourcecode/protocol.md | 33 ---
.../golang-sdk/refer/sourcecode/registry.md | 61 ----
.../mannual/golang-sdk/sourcecode/3.0_feature.md | 76 +++++
.../mannual/golang-sdk/sourcecode/_index.md | 15 +
.../golang-sdk/sourcecode/aop_and_extension.md | 115 ++++++++
.../golang-sdk/sourcecode/app_and_interface.md | 106 +++++++
.../mannual/golang-sdk/sourcecode/architecture.md | 66 +++++
.../mannual/golang-sdk/sourcecode/generic-2.md | 30 ++
.../mannual/golang-sdk/sourcecode/generic.md | 91 ++++++
.../mannual/golang-sdk/sourcecode/protocol.md | 106 +++++++
.../mannual/golang-sdk/sourcecode/registry.md | 112 ++++++++
.../overview/mannual/golang-sdk/tools/_index.md | 8 +
.../use_dubbogo_cli.md => tools/dubbogo-cli.md} | 40 ++-
.../tutorial/{deploy2 => deployment}/_index.md | 2 +-
.../tutorial/{deploy2 => deployment}/deploy.md | 13 +-
.../{deploy2 => deployment}/graceful_shutdown.md | 5 +-
.../tutorial/{deploy2 => deployment}/istio.md | 11 +-
.../proxyless_service_mesh.md | 13 +-
.../{deploy2 => deployment}/traffic_management.md | 14 +-
.../golang-sdk/tutorial/interoperability/_index.md | 6 +
.../dubbo-java}/_index.md | 3 +-
.../call_java_protocol_dubbo_non_protobuf.md | 1 +
.../call_java_protocol_triple_protobuf.md | 1 +
.../dubbo-java}/service-discovery.md | 2 +
.../grpc}/_index.md | 3 +-
.../grpc}/call_grpc.md | 1 +
.../golang-sdk/tutorial/observability/probe.md | 2 +-
.../golang-sdk/tutorial/observability/tracing.md | 3 +-
.../mannual/golang-sdk/tutorial/rpc/attachments.md | 218 ++++++++++++--
.../mannual/golang-sdk/tutorial/rpc/filter.md | 99 +++++--
.../mannual/golang-sdk/tutorial/rpc/openapi.md | 3 +-
.../mannual/golang-sdk/tutorial/rpc/protocol.md | 6 +-
.../mannual/golang-sdk/tutorial/rpc/streaming.md | 44 ++-
.../application-level-service-discovery.md | 150 ++++++++++
.../golang-sdk/tutorial/service-discovery/nacos.md | 6 +-
.../tutorial/service-discovery/zookeeper.md | 5 +-
.../tutorial/traffic/condition_router.md | 5 +
.../golang-sdk/tutorial/traffic/script_router.md | 4 +-
.../golang-sdk/tutorial/traffic/tag_router.md | 5 +
.../zh-cn/overview/mannual/golang-sdk/versions.md | 29 +-
.../overview/what/core-features/extensibility.md | 2 +-
.../zh-cn/overview/what/core-features/protocols.md | 2 +-
.../what/core-features/service-discovery.md | 2 +-
static/imgs/golang/architecture/arc.png | Bin 2068065 -> 574194 bytes
115 files changed, 3058 insertions(+), 2312 deletions(-)
diff --git a/content/en/overview/mannual/golang-sdk/introduction.md b/content/en/overview/mannual/golang-sdk/introduction.md
index 114eeaaff91..7621c76f65b 100644
--- a/content/en/overview/mannual/golang-sdk/introduction.md
+++ b/content/en/overview/mannual/golang-sdk/introduction.md
@@ -51,9 +51,9 @@ Based on the Dubbo-defined [triple protocol](/en/overview/reference/protocols/tr

For more details on cross-language or cross-product interoperability of dubbo-go, please refer to the following links:
-* [Interoperability with other Dubbo multi-language systems - based on triple+protobuf](../tutorial/interop-dubbo/)
-* [Interoperability with Dubbo2 Java - based on dubbo2+hessian2](../tutorial/interop-dubbo)
-* [Interoperability with gRPC systems](../tutorial/interop-grpc)
+* [Interoperability with other Dubbo multi-language systems - based on triple+protobuf](../tutorial/interoperability/dubbo-java/)
+* [Interoperability with Dubbo2 Java - based on dubbo2+hessian2](../tutorial/interoperability/dubbo-java/)
+* [Interoperability with gRPC systems](../tutorial/interoperability/grpc/)
#### Multi-Protocol Support
In addition to the triple protocol, dubbo-go supports more RPC protocols and serialization methods:
@@ -108,4 +108,3 @@ For specific enabling methods, please refer to the usage manual [Tracing](./tuto
The traffic governance rules implemented by dubbo-go fully comply with Dubbo framework-designed traffic governance capabilities. More details can be found through the following links:
* [Dubbo Traffic Governance Rule Design](/en/overview/core-features/traffic/)
* [Dubbo Traffic Governance Example Task](/en/overview/tasks/traffic-management/)
-
diff --git a/content/en/overview/mannual/golang-sdk/quickstart/microservices.md b/content/en/overview/mannual/golang-sdk/quickstart/microservices.md
index b5c40722a53..e6bf60e6f3c 100644
--- a/content/en/overview/mannual/golang-sdk/quickstart/microservices.md
+++ b/content/en/overview/mannual/golang-sdk/quickstart/microservices.md
@@ -11,6 +11,8 @@ weight: 2
This example demonstrates how to develop microservice applications using dubbo-go, adding core microservice capabilities such as service discovery, load balancing, and traffic control to the application.
+Sample source: <a href="https://github.com/apache/dubbo-go-samples/tree/main/registry/nacos" target="_blank">dubbo-go-samples/registry/nacos</a>.
+
## Prerequisites
In this example, we will continue to use Protobuf to develop the microservice application. Please refer to [Develop RPC Server and RPC Client](../rpc) to learn how to install necessary plugins like protoc and protoc-gen-go-triple.
@@ -187,4 +189,3 @@ If you want to add more service governance capabilities to the application, plea
<hr>
</div>
{{< /blocks/section >}}
-
diff --git a/content/en/overview/mannual/golang-sdk/quickstart/rpc.md b/content/en/overview/mannual/golang-sdk/quickstart/rpc.md
index 38f9bb4c786..c6e616486a8 100644
--- a/content/en/overview/mannual/golang-sdk/quickstart/rpc.md
+++ b/content/en/overview/mannual/golang-sdk/quickstart/rpc.md
@@ -14,6 +14,8 @@ Based on the Triple protocol defined by Dubbo, you can easily write browser and
This example demonstrates the RPC communication pattern based on the Triple protocol. The example uses Protocol Buffer to define the RPC service and demonstrates the processes of code generation, service publishing, and service access.
+Sample source: <a href="https://github.com/apache/dubbo-go-samples/tree/main/helloworld" target="_blank">dubbo-go-samples/helloworld</a>.
+
## Prerequisites
Since we are using Protocol Buffer, we first need to install the relevant code generation tools, including `protoc`, `protoc-gen-go`, and `protoc-gen-go-triple`.
@@ -28,7 +30,10 @@ Since we are using Protocol Buffer, we first need to install the relevant code g
```shell
go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
- go install github.com/dubbogo/protoc-gen-go-triple/v3@v3.0.3
+
+ git clone --depth 1 https://github.com/apache/dubbo-go.git
+ cd dubbo-go/tools/protoc-gen-go-triple
+ go install .
```
Make sure `protoc-gen-go` and `protoc-gen-go-triple` are in your `PATH`. You can verify this with `which protoc-gen-go`. If that command does not work, please execute the following commands:
@@ -38,11 +43,16 @@ Since we are using Protocol Buffer, we first need to install the relevant code g
[ -n "$(go env GOPATH)" ] && export PATH="$(go env GOPATH)/bin:${PATH}"
```
+ `protoc-gen-go-triple` is now maintained in the dubbo-go repository under
+ <a href="https://github.com/apache/dubbo-go/tree/main/tools/protoc-gen-go-triple" target="_blank">tools/protoc-gen-go-triple</a>.
+ Install it from that directory, and keep the generated `*.triple.go` files in sync when you change the `.proto`
+ service definition.
+
## Quick Run Example
### Download Example Source Code
We maintain a series of dubbo-go usage examples in the <a href="https://github.com/apache/dubbo-go-samples/" target="_blank">apache/dubbo-go-samples</a> repository to help users quickly learn how to use dubbo-go.
-You can <a href="https://github.com/apache/dubbo-go-samples/archive/refs/heads/master.zip" target="_blank">download the example zip file and unzip it</a>, or clone the repository:
+You can <a href="https://github.com/apache/dubbo-go-samples/archive/refs/heads/main.zip" target="_blank">download the example zip file and unzip it</a>, or clone the repository:
```shell
$ git clone --depth 1 https://github.com/apache/dubbo-go-samples
@@ -214,6 +224,10 @@ func main() {
This is the basic working principle of dubbo-go RPC!
+After the basic unary call is working, the same generated Triple client and server also support server streaming,
+client streaming, bidirectional streaming, request metadata, response headers and trailers, filters, health checks,
+timeouts, retries, and OpenAPI exposure. Continue with the RPC framework guides for these capabilities.
+
## More Content
{{< blocks/section color="white" height="auto">}}
<div class="td-content list-page">
@@ -243,4 +257,3 @@ This is the basic working principle of dubbo-go RPC!
<hr>
</div>
{{< /blocks/section >}}
-
diff --git a/content/en/overview/mannual/golang-sdk/refer/_index.md b/content/en/overview/mannual/golang-sdk/refer/_index.md
index c05c884ce24..3af79faf1ef 100644
--- a/content/en/overview/mannual/golang-sdk/refer/_index.md
+++ b/content/en/overview/mannual/golang-sdk/refer/_index.md
@@ -4,9 +4,16 @@ aliases:
- /en/docs3-v2/golang-sdk/refer/
- /en/overview/manual/golang-sdk/tutorial/develop/config-center/
- /en/overview/manual/golang-sdk/tutorial/develop/features/
-description: More reference materials for Dubbo-go
-title: Reference Manual
+description: Concept and integration references for current Dubbo Go applications.
+title: Reference
type: docs
-weight: 5
+weight: 6
---
+This section collects concept and integration reference pages that complement the quickstart and tutorial sections.
+
+Use it for:
+
+* generic invocation reference
+* registry integration notes such as Nacos
+* ecosystem repository overview
diff --git a/content/en/overview/mannual/golang-sdk/refer/ecology.md b/content/en/overview/mannual/golang-sdk/refer/ecology.md
index 48053bda909..545b764ccc9 100644
--- a/content/en/overview/mannual/golang-sdk/refer/ecology.md
+++ b/content/en/overview/mannual/golang-sdk/refer/ecology.md
@@ -2,64 +2,80 @@
aliases:
- /en/docs3-v2/golang-sdk/refer/ecology/
- /en/docs3-v2/golang-sdk/refer/ecology/
-description: Dubbo-go ecosystem components
+description: Current Dubbo Go ecosystem repositories and tooling
title: Ecosystem Components
type: docs
weight: 1
---
-### Dubbo-go
+Related repositories and samples:
-[github.com/apache/dubbo-go](https://github.com/apache/dubbo-go)
+* Main runtime: [apache/dubbo-go](https://github.com/apache/dubbo-go)
+* Samples: [apache/dubbo-go-samples](https://github.com/apache/dubbo-go-samples)
+* Generic invocation sample: [dubbo-go-samples/generic](https://github.com/apache/dubbo-go-samples/tree/main/generic)
+* Nacos registry sample: [dubbo-go-samples/registry/nacos](https://github.com/apache/dubbo-go-samples/tree/main/registry/nacos)
+* Triple sample: [dubbo-go-samples/rpc/triple](https://github.com/apache/dubbo-go-samples/tree/main/rpc/triple)
-The main repository for Apache Dubbo Go language implementation
+This page gives a current map of the main Dubbo Go ecosystem repositories. Some older documents still refer to repositories or tools under `dubbogo/*`; for daily development, use the Apache repositories below as the primary entry points.
-### Dubbo-go-samples
+## dubbo-go
+
+[github.com/apache/dubbo-go](https://github.com/apache/dubbo-go)
+
+The main Dubbo Go runtime repository. It includes:
+
+* core runtime code
+* built-in protocols, registries, filters, routers, and load balancers
+* tools such as `tools/protoc-gen-go-triple`
+* tools such as `tools/dubbogo-cli`
+
+## dubbo-go-samples
[github.com/apache/dubbo-go-samples](https://github.com/apache/dubbo-go-samples)
-Usage examples of dubbo-go:
-* config-api: Configuration initialization using APIs
-* configcenter: Using different configuration centers, currently supporting three: zookeeper, apollo, and nacos
-* context: How to use context to pass attachment
-* direct: Direct connection mode
-* game: Game service example
-* generic: Generic invocation
-* rpc: RPC invocation examples, including Triple, Dubbo, and cross-language/gRPC communication examples
-* helloworld: Introduction to RPC invocation example
-* logger: Logging example
-* registry: Demonstrates integration with different registration centers, including zk, nacos, etcd
-* metrics: Data reporting
-* filter: Examples using provided filters and custom filters
-* registry/servicediscovery: Application-level service discovery example
-* router: Routing example
-* tracing: Link tracing example
+This is the best place to look for runnable examples. Useful directories include:
-### Dubbo-go-pixiu
+* `helloworld`
+* `config_yaml`
+* `generic`
+* `registry/nacos`, `registry/zookeeper`, `registry/etcd`, `registry/polaris`
+* `rpc/triple`, `rpc/multi-protocols`, `rpc/grpc`
+* `filter/custom`, `filter/token`, `filter/sentinel`
+* `router/condition`, `router/tag`, `router/script`, `router/static_config`
+* `mesh`
+* `java_interop/*`
+* `triple_header_trailer`
-[github.com/apache/dubbo-go-pixiu](https://github.com/apache/dubbo-go-pixiu)
+## protoc-gen-go-triple
-The dubbo-go-pixiu gateway supports invoking dubbo/dubbo-go clusters using both dubbo and http protocols
+[apache/dubbo-go/tools/protoc-gen-go-triple](https://github.com/apache/dubbo-go/tree/main/tools/protoc-gen-go-triple)
-### Dubbo-getty
+The protobuf code generation plugin for Dubbo Go Triple services. New documentation should point to this location instead of the older standalone tool repositories.
-[github.com/apache/dubbo-getty](https://github.com/apache/dubbo-getty)
+## dubbogo-cli
-dubbo-getty is an asynchronous network IO library in Go language, supporting tcp/udp/websocket protocols.
+[apache/dubbo-go/tools/dubbogo-cli](https://github.com/apache/dubbo-go/tree/main/tools/dubbogo-cli)
-### Dubbo-go-hessian2
+Command-line helper tool for Dubbo/Dubbo Go debugging and interoperability scenarios. It now lives inside the main `apache/dubbo-go` repository.
+
+## dubbo-go-hessian2
[github.com/apache/dubbo-go-hessian2](https://github.com/apache/dubbo-go-hessian2)
-Dubbo-go-hessian2 is a Go language hessian2 serialization protocol library
+The Hessian2 serialization library used by Dubbo Go, especially in Dubbo protocol and generic invocation interoperability scenarios.
+
+## dubbo-getty
+
+[github.com/apache/dubbo-getty](https://github.com/apache/dubbo-getty)
+
+An asynchronous network IO library used in parts of the Dubbo Go ecosystem.
-### Dubbogo-tools
+## Notes on Older Repositories
-[github.com/dubbogo/tools](https://github.com/dubbogo/tools)
+Older articles may still mention:
-Includes
-- dubbo-cli tool (deprecated)
-- imports-formatter Go language imports block formatting tool
-- protoc-gen-triple PB compilation plugin
-- protoc-gen-dubbo3grpc PB compilation plugin
+* non-Apache historical tool repositories
+* older standalone Triple codegen tool repos
+* older CLI installation instructions
+For current Dubbo Go development, prefer the Apache repositories and the `tools/` directories inside `apache/dubbo-go`.
diff --git a/content/en/overview/mannual/golang-sdk/refer/generic.md b/content/en/overview/mannual/golang-sdk/refer/generic.md
index 982ec1d8f74..e08512a6278 100644
--- a/content/en/overview/mannual/golang-sdk/refer/generic.md
+++ b/content/en/overview/mannual/golang-sdk/refer/generic.md
@@ -3,108 +3,61 @@ aliases:
- /en/docs3-v2/golang-sdk/preface/concept/generic/
- /en/docs3-v2/golang-sdk/preface/concept/generic/
- /en/overview/mannual/golang-sdk/preface/concept/generic/
-description: Generic Invocation
-keywords: Generic Invocation
+description: Generic invocation reference
+keywords: Generic invocation
title: Generic Invocation
type: docs
weight: 2
---
-Generic invocation is a special way of calling in Dubbo-Go that allows intermediary nodes to pass call information without interface information, commonly used in testing and gateway scenarios. Generic invocation supports both Dubbo and Triple protocols. When creating a generic service via `client.NewGenericService`, Hessian2 is used as the default transport serialization.
+Related samples:
-## Background
+* Generic invocation sample: <a href="https://github.com/apache/dubbo-go-samples/tree/main/generic" target="_blank">dubbo-go-samples/generic</a>
+* Triple sample: <a href="https://github.com/apache/dubbo-go-samples/tree/main/rpc/triple" target="_blank">dubbo-go-samples/rpc/triple</a>
-For better understanding, this document introduces generic invocation with a gateway usage scenario. Let's first consider a normal invocation (non-generic invocation). The diagram below includes two key roles: consumer and provider (hereinafter referred to as endpoint, representing either a consumer or a provider), each having a definition of the org.apache.dubbo.sample.User interface. Suppose the org.apache.dubbo.sample.User interface needs to be used in the calling behavior.
+See also: [Source Code Guide: Generic Call](/en/overview/mannual/golang-sdk/sourcecode/generic/).
-
+Generic invocation lets a caller invoke a remote service without generated stubs for the target interface. It is commonly used in gateway, testing, interoperability, and dynamic invocation scenarios.
-RPC requires transmission over a network medium; therefore, data cannot be transmitted as go struct and must be transmitted in binary form. This requires that the consumer side serialize the struct implementing the org.apache.dubbo.sample.User interface into binary format before transmission. Likewise, for the provider side, the binary data needs to be deserialized into struct information. **In summary, normal invocation requires that interface information must have the same definition a [...]
+## Recommended Entry
-In gateway scenarios, it is impractical for the gateway to store all interface definitions. For example, if a gateway needs to forward 100 service calls, each requiring 10 interfaces, normal invocation would necessitate storing 1000 (100 * 10) interface definitions in advance, which is clearly difficult. So is there a way that does not require prior storage of interface definitions while still forwarding calls correctly? The answer is yes, which is the reason for using generic invocation.
+For current Dubbo Go, the recommended entry is:
-## Principle
+* `client.NewGenericService(...)`
+* `filter/generic.GenericService.Invoke(...)`
+* `filter/generic.GenericService.InvokeWithType(...)`
-Generic invocation essentially transforms a complex structure into a generic structure, where the generic structure refers to maps, strings, etc., which the gateway can smoothly parse and pass.
+This is the normal runtime path for new generic invocation code. Older `config.ReferenceConfig`-style examples are compatibility paths and should not be the default choice for new docs.
-
+## Typical Triple Usage
-Dubbo-go v3 supports multiple generic invocation modes, including Map (default), Gson, Protobuf-JSON, and Bean. Among these, Map is the most commonly used. The following uses it as an example. Taking the User interface as an example, its definition is as follows:
+For direct connection:
```go
-// definition
-type User struct {
- ID string
- Name string
- Age int32
-}
-
-func (u *User) JavaClassName() string {
- return "org.apache.dubbo.sample.User"
-}
-```
-
-Suppose a service call requires a user as an input parameter, which is defined as follows:
-
-```go
-// an instance of the User
-user := &User{
- ID: "1",
- Name: "Zhangsan",
- Age: 20,
+ins, err := dubbo.NewInstance(dubbo.WithName("generic-client"))
+if err != nil {
+ panic(err)
}
-```
-Then under the Map generic invocation, the user will be automatically converted to Map format as follows:
-
-```go
-usermap := map[interface{}]interface{} {
- "iD": "1",
- "name": "zhangsan",
- "age": 20,
- "class": "org.apache.dubbo.sample.User",
+cli, err := ins.NewClient()
+if err != nil {
+ panic(err)
}
-```
-
-Note that:
-
-- The Map generic invocation will automatically convert the first letter to lowercase, so ID will become iD. If you need to align with Dubbo-Java, consider changing ID to Id;
-- To precisely control the key names in the Map, you can use the `m` struct tag. For example, `` Name string `m:"userName"` `` will set the key to `userName` instead of the default `name`;
-- When the struct implements the `hessian.POJO` interface, a `class` field will be automatically inserted into the generalized result to identify the original interface class. This behavior can be disabled by setting `generic.include.class=false`, which is suitable for generic invocation between pure Go services.
-
-## Usage
-
-Generic invocation is transparent to the provider side, meaning the provider does not need any explicit configuration to handle generic requests correctly.
-
-### Generic Invocation over Triple Protocol
-
-The Triple protocol (dubbo3) supports generic invocation. `NewGenericService` uses a unified dial flow internally, supporting both service discovery via a registry and direct connection via `client.WithURL`. For a complete example, see [dubbo-go-samples/generic](https://github.com/apache/dubbo-go-samples/tree/main/generic). The following uses direct connection as an example.
-
-First, create a dubbo instance and a client, then create a generic service via `cli.NewGenericService`, as shown below.
-
-```go
-ins, err := dubbo.NewInstance(dubbo.WithName("generic-client"))
-
-cli, err := ins.NewClient(
- client.WithClientProtocolTriple(),
- client.WithClientSerialization(constant.Hessian2Serialization),
-)
genericService, err := cli.NewGenericService(
"org.apache.dubbo.samples.UserProvider",
+ client.WithProtocolTriple(),
+ client.WithSerialization(constant.Hessian2Serialization),
client.WithURL("tri://127.0.0.1:50052"),
client.WithVersion("1.0.0"),
client.WithGroup("triple"),
)
+if err != nil {
+ panic(err)
+}
```
-The `NewGenericService` method accepts the following parameters:
-
-- Service interface name;
-- `client.WithURL`: direct connection address, using the `tri://` protocol prefix;
-- `client.WithVersion`: service version;
-- `client.WithGroup`: service group.
-
-Then you can make a generic invocation on the service:
+Then invoke the remote method dynamically:
```go
resp, err := genericService.Invoke(
@@ -115,208 +68,50 @@ resp, err := genericService.Invoke(
)
```
-### Based on Dubbo URL Generic Invocation
-
-The generic invocation based on Filter is transparent to the consumer, and a typical application scenario is a gateway. This method requires that the Dubbo URL contains a generic invocation identifier, as follows.
-
-```plain
-dubbo://127.0.0.1:20000/org.apache.dubbo.sample.UserProvider?generic=true&...
-```
-
-The semantics expressed by this Dubbo URL are:
-
-- The RPC protocol is dubbo;
-- The org.apache.dubbo.sample.UserProvider interface is located at 127.0.0.1:20000;
-- Using generic invocation (generic=true).
-
-The consumer's Filter will automatically convert normal calls to generic calls based on the configuration carried by the Dubbo URL. When `inv.Reply()` is set to a target struct pointer, the consumer-side Filter will automatically deserialize the map result into the corresponding object during the `OnResponse` phase; if not set, the response will still be returned in generic format (e.g., map).
-
-### Manual Generic Invocation (Legacy)
-
-> It is recommended to use `client.NewGenericService` as described above. The following is the legacy approach based on `config.ReferenceConfig`, provided for reference only.
+This mode is the easiest way to understand generic invocation, and it matches the current `dubbo-go-samples/generic` layout.
-Manual generic invocation constructs a reference via `config.ReferenceConfig` and explicitly initiates a generic invocation, a typical application scenario for testing.
+## Automatic Result Mapping
-Generic invocation does not require creating a configuration file (dubbogo.yaml), but requires manual configuration of the registry, reference, and other information in the code. The initialization method is encapsulated in the newRefConf method, as follows.
+If you want a typed Go result instead of manually converting the returned map, use `InvokeWithType(...)`:
```go
-func newRefConf(appName, iface, protocol string) config.ReferenceConfig {
- registryConfig := &config.RegistryConfig{
- Protocol: "zookeeper",
- Address: "127.0.0.1:2181",
- }
-
- refConf := config.ReferenceConfig{
- InterfaceName: iface,
- Cluster: "failover",
- Registry: []string{"zk"},
- Protocol: protocol,
- Generic: "true",
- }
-
- rootConfig := config.NewRootConfig(config.WithRootRegistryConfig("zk", registryConfig))
- _ = rootConfig.Init()
- _ = refConf.Init(rootConfig)
- refConf.GenericLoad(appName)
-
- return refConf
-}
-```
-
-The newRefConf method takes three parameters:
-
-- appName: application name;
-- iface: service interface name;
-- protocol: RPC protocol, currently only supporting dubbo and tri (triple protocol).
-
-In the above method, for simplicity, the registry is set as a fixed value, using ZooKeeper at 127.0.0.1:2181 as the registry, which can be customized according to actual conditions in practice.
-
-We can easily obtain a ReferenceConfig instance, temporarily named refConf.
-
-```go
-refConf := newRefConf("example.dubbo.io", "org.apache.dubbo.sample.UserProvider", "tri")
-```
-
-Next, we can invoke the GetUser method of the org.apache.dubbo.sample.UserProvider service using generic invocation.
-
-```go
-resp, err := refConf.
- GetRPCService().(*generic.GenericService).
- Invoke(
- context.TODO(),
- "GetUser",
- []string{"java.lang.String"},
- []hessian.Object{"A003"},
- )
-```
-
-The Invoke method of GenericService takes four parameters:
-
-- context;
-- method name: in this example, it refers to calling the GetUser method;
-- parameter types: GetUser method accepts a string type parameter. If the target method accepts multiple parameters, you can write it as `[]string{"type1", "type2", ...}`. If the method is parameterless, you need to fill in an empty array `[]string{}`;
-- actual parameters: written the same way as parameter types. If it is a parameterless function, you still need to fill in an empty array `[]hessian.Object{}` as a placeholder.
-
-### Automatic Deserialization with InvokeWithType
-
-In the `Invoke` method, the return value `resp` is a `map` type (for `MapGeneralizer`), requiring users to manually perform type conversion. To simplify this process, dubbo-go provides the `InvokeWithType` method, which can automatically deserialize the result into a user-specified struct.
-
-The following example uses the `client.NewGenericService` approach:
-
-```go
-// Define the result struct
type User struct {
- ID string
- Name string
- Age int32
+ ID string
+ Name string
+ Age int32
}
var user User
-// Deserialize the result directly into the user struct
-err := genericService.InvokeWithType(
- context.Background(),
- "GetUser1",
- []string{"java.lang.String"},
- []hessian.Object{"A003"},
- &user,
+err = genericService.InvokeWithType(
+ context.Background(),
+ "GetUser1",
+ []string{"java.lang.String"},
+ []hessian.Object{"A003"},
+ &user,
)
-
-if err != nil {
- // Handle error
-}
-fmt.Println(user.Name)
-```
-
-When using the legacy `config.ReferenceConfig` approach, the calling method is as follows:
-
-```go
-var user User
-err := refConf.
- GetRPCService().(*generic.GenericService).
- InvokeWithType(
- context.TODO(),
- "GetUser",
- []string{"java.lang.String"},
- []hessian.Object{"A003"},
- &user,
- )
-
-if err != nil {
- // Handle error
-}
-fmt.Println(user.Name)
```
-Note: `InvokeWithType` currently only supports the default Map generic invocation.
-
-## Generic Mode Selection
-
-Dubbo-go supports the following four generic invocation modes, distinguished by the `generic` parameter value:
-
-| Mode | Parameter Value | Generalized Format | Use Case |
-|------|----------------|-------------------|----------|
-| Map (default) | `true` | `map[string]any` | General purpose, Go and Java interoperability |
-| Gson | `gson` | JSON string | Scenarios requiring JSON format interaction |
-| Protobuf-JSON | `protobuf-json` | JSON string | Generic invocation of Protobuf messages |
-| Bean | `bean` | `JavaBeanDescriptor` | Alignment with Java Bean serialization |
-
-When using `client.NewGenericService`, the Map mode is used by default. To use other modes, set the `Generic` field in `ReferenceConfig` to the corresponding parameter value.
-
-In most scenarios, the default Map generic mode is recommended.
-
-## Cross-language RPC contract guidance
+`InvokeWithType(...)` is useful when the transport is generic but the caller still wants a concrete Go struct result.
-In generic invocation or cross-language scenarios, Go variadic method signatures such as `args ...string` can introduce contract ambiguity.
-Existing variadic services remain supported, but `...T` is not recommended in new RPC contracts for cross-language or generic-invocation-facing services.
+## Generic Modes
-The reason is that variadic parameters have special semantics in Go, while cross-language invocation, dynamic argument assembly, generic invocation, and serialization usually represent them as ordinary arrays or lists.
-This increases the risk that callers and providers interpret the argument shape differently.
+Dubbo Go supports several generic modes through the `generic` setting:
-### Recommended patterns
-
-For new service contracts, prefer the following patterns:
-
-- Use `[]T` instead of `...T` for repeated values of the same type
-- Use request/response structs when the input shape may evolve over time
-- Use Triple + Protobuf IDL for new cross-language services, and model repeated inputs with `repeated` fields
-
-### Migration examples
-
-Avoid introducing new cross-language contracts like this:
-
-```go
-func MultiArgs(ctx context.Context, args ...string) error
-```
+| Mode | Value | Result shape | Typical usage |
+| --- | --- | --- | --- |
+| Map | `true` | `map[string]any`-style data | default and most common |
+| Gson | `gson` | JSON string | JSON-oriented interoperability |
+| Protobuf-JSON | `protobuf-json` | JSON string | protobuf service interoperability |
+| Bean | `bean` | Java bean descriptor | Java-specific compatibility |
-Prefer a slice parameter instead:
-
-```go
-func MultiArgs(ctx context.Context, args []string) error
-```
-
-If the contract may evolve further, prefer a request object:
-
-```go
-type MultiArgsRequest struct {
- Args []string
-}
-
-func MultiArgs(ctx context.Context, req *MultiArgsRequest) error
-```
-
-For new Triple + Protobuf services, use a `repeated` field to model repeated inputs:
-
-```proto
-message MultiArgsRequest {
- repeated string args = 1;
-}
-```
+For most Go and Go/Java interoperability scenarios, the default Map mode is still the most practical choice.
-### Compatibility note
+## Contract Guidance
-Existing variadic services remain supported. This guidance is mainly intended for new service contract design.
-If a service is expected to support cross-language consumers, gateway forwarding, or generic invocation, it is better not to expose variadic parameters as part of the public RPC contract.
+When a service is expected to support generic invocation or cross-language consumers:
-In general, business inputs should be modeled explicitly as structured fields. Non-business context should be passed through attachments or IDL metadata instead of variadic parameters.
+* prefer explicit request structs over complex ad hoc argument lists;
+* prefer `[]T` over variadic `...T` in public RPC contracts;
+* prefer Triple + Protobuf IDL for new cross-language services.
-Related reading: [【Dubbo-go Service Proxy Model】](https://blog.csdn.net/weixin_39860915/article/details/122738548)
+This keeps method signatures easier to model in dynamic callers, gateways, and generic serializers.
diff --git a/content/en/overview/mannual/golang-sdk/refer/nacos.md b/content/en/overview/mannual/golang-sdk/refer/nacos.md
index f85d7784092..222f83b860f 100644
--- a/content/en/overview/mannual/golang-sdk/refer/nacos.md
+++ b/content/en/overview/mannual/golang-sdk/refer/nacos.md
@@ -2,147 +2,105 @@
aliases:
- /en/docs3-v2/golang-sdk/tutorial/develop/registry/nacos/
- /en/docs3-v2/golang-sdk/tutorial/develop/registry/nacos/
-description: Using Nacos as a Registry
+description: Using Nacos as a registry in current Dubbo Go
title: Using Nacos as a Registry
type: docs
weight: 10
---
+Related samples:
+* Nacos registry sample: <a href="https://github.com/apache/dubbo-go-samples/tree/main/registry/nacos" target="_blank">dubbo-go-samples/registry/nacos</a>
+* Application-level discovery reference: <a href="https://github.com/apache/dubbo-go-samples/tree/main/registry/nacos" target="_blank">dubbo-go-samples/registry/nacos</a>
-## 1. Preparation
+See also:
-- The dubbo-go CLI tool and dependencies are installed
-- Create a new demo application
+* [Application-level Service Discovery](/en/overview/mannual/golang-sdk/tutorial/service-discovery/application-level-service-discovery/)
+* [Tools: dubbogo-cli](/en/overview/mannual/golang-sdk/tools/dubbogo-cli/)
-## 2. Using grpc_cli Tool for Dubbo Service Debugging
+This page is a current reference for using Nacos as a registry with Dubbo Go. Older versions of this page described a CLI debugging flow; that content is no longer the main Nacos integration path.
-### 2.1 Start the Server
-Example: user.go:
-```go
-func (u *UserProvider) GetUser(ctx context.Context, userStruct *CallUserStruct) (*User, error) {
- fmt.Printf("=======================\nreq:%#v\n", userStruct)
- rsp := User{"A002", "Alex Stocks", 18, userStruct.SubInfo}
- fmt.Printf("=======================\nrsp:%#v\n", rsp)
- return &rsp, nil
-}
+## What the Nacos Sample Demonstrates
-```
-The server exposes a service named GetUser, taking a CallUserStruct parameter and returning a User parameter.\
-Definition of CallUserStruct parameter:
-```go
-type CallUserStruct struct {
- ID string
- Male bool
- SubInfo SubInfo // Nested substructure
-}
-func (cs CallUserStruct) JavaClassName() string {
- return "com.ikurento.user.CallUserStruct"
-}
-
-type SubInfo struct {
- SubID string
- SubMale bool
- SubAge int
-}
-
-func (s SubInfo) JavaClassName() string {
- return "com.ikurento.user.SubInfo"
-}
+The current `registry/nacos` sample shows:
+* provider registration into Nacos
+* consumer lookup through Nacos
+* Triple-based RPC call flow
+* registry-backed service discovery for Go applications
+
+The sample includes:
+
+* `go-server/cmd/server.go`
+* `go-client/cmd/client.go`
+* `proto/greet.proto`
+
+## Start Nacos
+
+First start a Nacos server and make sure it is reachable from your Dubbo Go applications. The sample README uses the standard Nacos server and default web console.
+
+## Run the Provider
+
+From the sample:
+
+```bash
+go run ./go-server/cmd/server.go
```
-Definition of User structure:
-```go
-type User struct {
- Id string
- Name string
- Age int32
- SubInfo SubInfo // Nesting the above substructure SubInfo
-}
-
-func (u *User) JavaClassName() string {
- return "com.ikurento.user.User"
-}
-```
-Start the service:
-
-`cd server `\
-`source builddev.sh`\
-`go run .`
-
-### 2.2 Define the Request Body (Packing/Unpacking Protocol)
-
-The request body is defined as a JSON file, with the convention that all keys are strings.\
-Keys correspond to Go struct field names such as "ID", "Name", and values correspond to "type@val".\
-The types supported are string, int, bool, time, with val initialized as a string. If only the type is provided, it is initialized to zero value.\
-It is required for each struct to have a JavaClassName field, which must strictly correspond with the server side.
-
-See userCall.json:
-```json
-{
- "ID": "string@A000",
- "Male": "bool@true",
- "SubInfo": {
- "SubID": "string@A001",
- "SubMale": "bool@false",
- "SubAge": "int@18",
- "JavaClassName":"string@com.ikurento.user.SubInfo"
- },
- "JavaClassName": "string@com.ikurento.user.CallUserStruct"
-}
+The provider exports the service and registers it into Nacos.
+
+You can verify the service is up by sending an HTTP request to the sample service endpoint:
+
+```bash
+curl \
+ --header "Content-Type: application/json" \
+ --data '{"name": "Dubbo"}' \
+ http://localhost:20000/greet.GreetService/Greet
```
-userCall.json defines the structure of CallUserStruct and its substructure SubInfo, and assigns values to the request parameters.
-
-Similarly for user.json, no initial values are needed for return values, but the JavaClassName field must strictly correspond to the server side.
-```go
-{
- "ID": "string",
- "Name": "string",
- "Age": "int",
- "JavaClassName": "string@com.ikurento.user.User",
- "SubInfo": {
- "SubID": "string",
- "SubMale": "bool",
- "SubAge": "int",
- "JavaClassName":"string@com.ikurento.user.SubInfo"
- }
-}
+
+## Run the Consumer
+
+Then run:
+
+```bash
+go run ./go-client/cmd/client.go
```
-### 2.3 Execute Request
-`dubbogo-cli call --h=localhost --p 20001 --proto=dubbo --i=com.ikurento.user.UserProvider --method=GetUser --sendObj="./userCall.json" --recvObj="./user.json"`
+The consumer resolves the target service through Nacos and performs the RPC call.
-CLI prints the result:
-```log
-2020/10/26 20:47:45 Created pkg:
-2020/10/26 20:47:45 &{ID:A000 Male:true SubInfo:0xc00006ea20 JavaClassName:com.ikurento.user.CallUserStruct}
-2020/10/26 20:47:45 SubInfo:
-2020/10/26 20:47:45 &{SubID:A001 SubMale:false SubAge:18 JavaClassName:com.ikurento.user.SubInfo}
+## Configuration Shape
+In current Dubbo Go, Nacos can appear in several related places:
-2020/10/26 20:47:45 Created pkg:
-2020/10/26 20:47:45 &{ID: Name: Age:0 JavaClassName:com.ikurento.user.User SubInfo:0xc00006ec90}
-2020/10/26 20:47:45 SubInfo:
-2020/10/26 20:47:45 &{SubID: SubMale:false SubAge:0 JavaClassName:com.ikurento.user.SubInfo}
+* instance-level setup with `dubbo.WithRegistry(registry.WithNacos(), ...)`
+* reference-level setup with `client.WithRegistry(...)` or `client.WithRegistryIDs(...)`
+* service-level setup with `server.WithRegistry(...)` or `server.WithRegistryIDs(...)`
+* configuration-file setup under `registries`
+Useful registry options come from `registry/options.go`, including:
-2020/10/26 20:47:45 connected to localhost:20001!
-2020/10/26 20:47:45 try calling interface:com.ikurento.user.UserProvider.GetUser
-2020/10/26 20:47:45 with protocol:dubbo
+* `registry.WithNacos()`
+* `registry.WithAddress(...)`
+* `registry.WithGroup(...)`
+* `registry.WithNamespace(...)`
+* `registry.WithRegisterService()`
+* `registry.WithRegisterInterface()`
+* `registry.WithRegisterServiceAndInterface()`
-2020/10/26 20:47:45 After 3ms , Got Rsp:
-2020/10/26 20:47:45 &{ID:A002 Name:Alex Stocks Age:18 JavaClassName: SubInfo:0xc0001241b0}
-2020/10/26 20:47:45 SubInfo:
-2020/10/26 20:47:45 &{SubID:A001 SubMale:false SubAge:18 JavaClassName:}```
-```
-You can see detailed request body assignment, return results, and elapsed time. Nested structures are supported.
+## Application-Level Discovery
-Server logs:
-```
-=======================
-req:&main.CallUserStruct{ID:"A000", Male:true, SubInfo:main.SubInfo{SubID:"A001", SubMale:false, SubAge:18}}
-=======================
-```
-It shows that data from CLI has been received.
+For current Dubbo Go deployments, Nacos is commonly used together with application-level service discovery. In that model:
+
+* providers register application instances and metadata;
+* consumers resolve service-to-application mapping;
+* metadata is used to recover callable service endpoints.
+
+If you are deciding between old interface-level registration and current defaults, start from the application-level service discovery page linked above.
+
+## About dubbogo-cli
+
+`dubbogo-cli` can still be useful for debugging and interoperability workflows, but it is no longer the primary content of the Nacos registry page. If you need the CLI, install it from:
+
+* [apache/dubbo-go/tools/dubbogo-cli](https://github.com/apache/dubbo-go/tree/main/tools/dubbogo-cli)
+and read the dedicated tools page.
diff --git a/content/en/overview/mannual/golang-sdk/refer/sourcecode/3.0_feature.md b/content/en/overview/mannual/golang-sdk/refer/sourcecode/3.0_feature.md
deleted file mode 100644
index 577543af93c..00000000000
--- a/content/en/overview/mannual/golang-sdk/refer/sourcecode/3.0_feature.md
+++ /dev/null
@@ -1,81 +0,0 @@
----
-aliases:
- - /en/docs3-v2/golang-sdk/preface/3.0_feature/
- - /en/docs3-v2/golang-sdk/preface/3.0_feature/
- - /en/overview/mannual/golang-sdk/preface/3.0_feature/
-description: New features of Dubbo-go 3.0
-keywords: New features
-title: New features
-type: docs
-weight: 3
----
-
-
-
-
-
-
-
-
-## 1. Triple Protocol
-
-### 1.1 Overview
-
-
-
-- Communication level
-
- The Triple protocol, also known as the Dubbo3 protocol, is an extended protocol based on HTTP2 + gRPC, which adds specific fields and logical enhancements, ensuring interoperability with the **native gRPC protocol**. On this basis, the Triple new protocol will more natively support **Dubbo service governance capabilities** and support **streaming RPC calls**.
-
- In simple terms, it can be understood as Triple = gRPC + Dubbo.
-
-- Serialization
-
- The Triple protocol uses an efficient **PB serialization method** and adds **extensible support** for serialization protocols.
-
-- User development habits:
-
- Triple services require **pre-defined .proto files** before development, which facilitates Go developers who prefer to define IDL before coding. This differs from the Dubbo-go 1.x version that defines JavaClassName to describe interfaces in line with Java programming habits.
-
-- Cross-language interoperability:
-
- It can achieve **cross-language interoperability** with Dubbo-Java.
-
-
-## 2. Application-level Service Discovery
-
-### 2.1 Introduction
-
-
-
-During the service registration phase, server instances register application-level information, mainly mapping application names to instance IPs in the registration center. In the service discovery phase, client instances obtain the required service instance IP through the registration center. The service introspection phase follows, where the process of service introspection involves obtaining interface information through application information. As shown in the figure, there are two modes:
-
-1. remote mode: obtaining application to interface metadata mapping through a metadata center (e.g., zk).
-2. local mode: obtaining application to interface metadata mapping directly from the server (initiating an RPC call to the Metadata Service through the Dubbo protocol).
-
-After service introspection, the client officially initiates a call to the corresponding instance. The most obvious benefit of this approach is the reduced data volume for the registration center, which only retains application-level data.
-
-When using Dubbo-go 3.0's application-level service discovery capabilities, users can follow the examples to configure the service introspection mode and metadata center information directly in the configuration file, add dependencies, and enable application-level service discovery.
-
-### 2.2 Article on Application-level Service Discovery
-
-[Application-level service discovery analysis](https://baijiahao.baidu.com/s?id=1669266413887039723&wfr=spider&for=pc)
-
-## 3. Mesh Routing Rules
-
-Users can define routing files:
-
-virtual_service.yaml
-
-
-
-and dist_rule.yml
-
-
-
-The framework can forward traffic based on routing files for specific requests.
-
-## 4. Related Articles
-
-Official Alibaba Cloud introduction article: [“Dubbo 3.0 - Opening the Next Generation of Cloud-native Microservices”](https://developer.aliyun.com/article/770964?utm_content=g_1000175535)
-
diff --git a/content/en/overview/mannual/golang-sdk/refer/sourcecode/_index.md b/content/en/overview/mannual/golang-sdk/refer/sourcecode/_index.md
deleted file mode 100644
index e2c80537bb4..00000000000
--- a/content/en/overview/mannual/golang-sdk/refer/sourcecode/_index.md
+++ /dev/null
@@ -1,11 +0,0 @@
----
-aliases:
- - /en/docs3-v2/golang-sdk/sourcecode/
- - /en/docs3-v2/golang-sdk/sourcecode/
- - /en/overview/mannual/golang-sdk/sourcecode/
-description: Dubbo-go Source Code Interpretation
-title: Source Code Interpretation
-type: docs
-weight: 4
----
-
diff --git a/content/en/overview/mannual/golang-sdk/refer/sourcecode/aop_and_extension.md b/content/en/overview/mannual/golang-sdk/refer/sourcecode/aop_and_extension.md
deleted file mode 100644
index 267de0c7e7b..00000000000
--- a/content/en/overview/mannual/golang-sdk/refer/sourcecode/aop_and_extension.md
+++ /dev/null
@@ -1,111 +0,0 @@
----
-aliases:
- - /en/docs3-v2/golang-sdk/preface/design/aop_and_extension/
- - /en/docs3-v2/golang-sdk/preface/design/aop_and_extension/
- - /en/overview/mannual/golang-sdk/preface/design/aop_and_extension/
-description: AOP and Extension Mechanism
-keywords: AOP and Extension Mechanism
-title: AOP and Extension Mechanism
-type: docs
----
-
-## 1. Extension Module and Init Method
-
-### 1.1 Interface and Implementation
-
-In Golang, an interface is often accompanied by multiple implementation classes. Dubbo-go provides a pluggable and extensible mechanism for interface implementation classes, reducing coupling between modules and facilitating developers in introducing and customizing components.
-
-### 1.2 Init Method in Golang
-
-The init method, as a special method in Golang, executes first on program startup when a user imports a set of modules, performing loading logic. This method is an important way for dubbogo to register extension components.
-
-### 1.3 Extension Module
-
-In the framework source code, there is a special module: common/extension, which is responsible for caching all the implementations of the extensible components.
-
-Taking the load balancing module as an example: common/extension/loadbalance.go
-
-```go
-package extension
-
-import (
- "dubbo.apache.org/dubbo-go/v3/cluster/loadbalance"
-)
-
-var loadbalances = make(map[string]func() loadbalance.LoadBalance)
-
-// SetLoadbalance sets the loadbalance extension with @name
-// For example: random/round_robin/consistent_hash/least_active/...
-func SetLoadbalance(name string, fcn func() loadbalance.LoadBalance) {
- loadbalances[name] = fcn
-}
-
-// GetLoadbalance finds the loadbalance extension with @name
-func GetLoadbalance(name string) loadbalance.LoadBalance {
- if loadbalances[name] == nil {
- panic("loadbalance for " + name + " is not existing, make sure you have import the package.")
- }
-
- return loadbalances[name]()
-}
-```
-
-This module contains Get and Set methods. Get returns the instantiated LoadBalance interface, while Set is used to register factory functions, with a map used for caching these functions.
-
-When the user imports _ "dubbo.apache.org/dubbo-go/v3/cluster/loadbalance/random", the corresponding module's init function will be loaded, calling the Set method to register the unique key and factory function into the above map.
-
-cluster/loadbalance/random/loadbalance.go
-
-```go
-package random
-
-import (
- "math/rand"
-)
-
-import (
- "dubbo.apache.org/dubbo-go/v3/cluster/loadbalance"
- "dubbo.apache.org/dubbo-go/v3/common/constant"
- "dubbo.apache.org/dubbo-go/v3/common/extension"
- "dubbo.apache.org/dubbo-go/v3/protocol"
-)
-
-func init() {
- extension.SetLoadbalance(constant.LoadBalanceKeyRandom, NewRandomLoadBalance)
-}
-```
-
-Thus, once all init methods have been executed, the instantiated object can be obtained through the extension module's Get method.
-
-### 1.4 Imports Module
-
-Dubbogo places all built-in modules in imports/imports.go; users need to import this module to use the basic capabilities provided by the framework.
-
-```go
-import (
- _ "dubbo.apache.org/dubbo-go/v3/imports"
-)
-```
-
-## 2. Component Loading Process
-
-1. The user imports _ "dubbo.apache.org/dubbo-go/v3/imports"
-
-2. The program starts, executing the init functions sequentially, registering factory functions/instantiated objects to the extension module.
-
-3. The framework starts, loading configuration, retrieving module keys from the configuration and obtaining instantiated objects based on these keys.
-
-4. Users can also manually call the extension's Get method to obtain instantiated objects and use them directly.
-
-## 3. Custom Components
-
-Based on the above introduction, developers can emulate built-in modules and write custom extension components.
-
-## 4. Aspect-Oriented Programming Design (AOP)
-
-In the Dubbo-go service framework, many interfaces are designed based on AOP concepts. For example, Invoker, Filter, LoadBalance, and Router.
-
-These multiple implementations often form a chain of calls, with a single implementation class only handling its relevant logic.
-
-Related Reading: [【AOP wikipedia】](https://en.wikipedia.org/wiki/Aspect-oriented_programming)
-
diff --git a/content/en/overview/mannual/golang-sdk/refer/sourcecode/app_and_interface.md b/content/en/overview/mannual/golang-sdk/refer/sourcecode/app_and_interface.md
deleted file mode 100644
index a138d4443d4..00000000000
--- a/content/en/overview/mannual/golang-sdk/refer/sourcecode/app_and_interface.md
+++ /dev/null
@@ -1,75 +0,0 @@
----
-aliases:
- - /en/docs3-v2/golang-sdk/preface/design/app_and_interface/
- - /en/docs3-v2/golang-sdk/preface/design/app_and_interface/
- - /en/overview/mannual/golang-sdk/preface/design/app_and_interface/
-description: The Application and Interface of Dubbo
-keywords: Basic Concepts
-title: The Application and Interface of Dubbo
-type: docs
----
-
-
-
-
-
-
-## Dubbogo Service Levels
-
-Dubbogo service levels consist of two levels: Application Level and Interface Level, which are closely related to the **framework configuration** structure.
-
-As shown in the diagram below, the components at the application level are marked in light red, while those at the interface level are marked in light blue:
-
-
-
-## 1. Application Level Components
-
-Characteristics of application level components: shared by all interface level components of the current application.
-
-The main components at the application level are as follows:
-
-- Application Information Module
-
- Contains information related to the application dimension, including application name, version number, data reporting method, etc.
-
-- Consumer Module
-
- The Consumer module is responsible for client-related information, including one or more Reference structures, as well as timeout, client filters, and other related information.
-
-- Provider Module
-
- The Provider module is responsible for server-related information, including one or more Service structures, server filters, and other related information.
-
-- Registry Module
-
- The registry module is responsible for defining a series of registries to be used, such as ZK, Nacos, ETCD, etc. The application-level registry module only declares, referenced by interface-level components, using a user-defined registry ID as an index.
-
-- Protocol Module
-
- The protocol module only exists on the server.
-
- It concerns service exposure information, such as protocol name, service listening IP, port number, etc. It belongs to the application level, only declaring and referenced by interface-level components, using a user-defined protocol ID as an index.
-
-- Metadata Center Module
-
- Similar to the registry module, it is responsible for declaring the metadata center needed by the framework to successfully report metadata.
-
-- Configuration Center Module
-- Routing Module
-- Logging Module
-- Monitoring Module
-
-## 2. Interface Level Components
-
-- Service Module
-
- Used for any exposed service, declaring the information required for interface exposure, including interface name, protocol, serialization method, etc., responsible for exposing a single service interface.
-
-- Reference Module
-
- Used for clients that need to call remote services, declaring the information required for requesting interfaces, including interface name, protocol, serialization method, etc., and abstracting specific protocols involved in client generation.
-
-## 3. Explanation
-
-Exposed services are at the interface level. A user-defined Provider Struct / a user-defined Consumer Struct corresponds to a Service / Reference module. An application can have both Consumer and Provider modules simultaneously, allowing multiple Service / Reference modules to exist at the same time.
-
diff --git a/content/en/overview/mannual/golang-sdk/refer/sourcecode/architecture.md b/content/en/overview/mannual/golang-sdk/refer/sourcecode/architecture.md
deleted file mode 100644
index 62f9b3e56d1..00000000000
--- a/content/en/overview/mannual/golang-sdk/refer/sourcecode/architecture.md
+++ /dev/null
@@ -1,32 +0,0 @@
----
-aliases:
- - /en/docs3-v2/golang-sdk/preface/design/architecture/
- - /en/docs3-v2/golang-sdk/preface/design/architecture/
- - /en/overview/mannual/golang-sdk/preface/design/architecture/
-description: Architecture
-keywords: Architecture
-title: Architecture
-type: docs
----
-
-
-
-
-
-
-### Architecture Description
-
-
-
-### Node Description
-
-* `Registry` : The registry center responsible for service registration and discovery in dubbo-go
-* `Consumer` : The service consumer that calls remote services
-* `Provider` : The service provider that exposes services
-
-### Process Description
-* `0. register` : When the service provider starts, it will automatically register its services with the registry center
-* `1. subscribe` : The service consumer will subscribe to the services it needs from the registry center upon starting
-* `2. notify` : The registry center returns service registration information to the service consumer. When the subscribed service changes, the change data will be pushed to the consumer
-* `3. invoke` : The service consumer selects a suitable service address based on the service addresses obtained from the registry center and initiates a request after applying the load balancing algorithm
-
diff --git a/content/en/overview/mannual/golang-sdk/refer/sourcecode/generic-2.md b/content/en/overview/mannual/golang-sdk/refer/sourcecode/generic-2.md
deleted file mode 100644
index 2ec3cb80776..00000000000
--- a/content/en/overview/mannual/golang-sdk/refer/sourcecode/generic-2.md
+++ /dev/null
@@ -1,112 +0,0 @@
----
-aliases:
- - /en/docs3-v2/golang-sdk/tutorial/develop/features/generic/
- - /en/docs3-v2/golang-sdk/tutorial/develop/features/generic/
- - /en/docs3-v2/golang-sdk/tutorial/develop/features/generic-2/
- - /en/docs3-v2/golang-sdk/tutorial/develop/features/generic-2/
- - /en/overview/mannual/golang-sdk/tutorial/develop/features/generic/
-description: Generic Invocation
-title: Generic Invocation
-type: docs
-weight: 8
----
-
-
-
-
-
-
-## 1. Dubbogo Generic Invocation to Java Server
-
-Using Triple protocol + hessian2 serialization scheme
-
-Refer to Dubbogo 3.0 [Generic Invocation Documentation](https://www.yuque.com/docs/share/f4e72670-74ab-45b9-bc0c-4b42249ed953?#)
-
-### 1.1 Java Server Startup
-
-1. Transmission structure definition
-
-```java
-package org.apache.dubbo;
-
-import java.io.Serializable;
-import java.util.Date;
-
-public class User implements Serializable {
- private String id;
-
- private String name;
-
- private int age;
-
- private Date time = new Date();
-}
-```
-
-2. Interface definition
-
-```java
-package org.apache.dubbo;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-//import org.apache.dubbo.rpc.filter.GenericFilter;
-
-public interface UserProvider {
- User GetUser1(String userId);
-}
-```
-
-### 1.2 Go-Client Generic Invocation
-
-Here is the construction of the generic interface reference in the form of API
-
-```go
-// Initialize Reference configuration
-refConf := config.NewReferenceConfigBuilder().
- SetInterface("org.apache.dubbo.UserProvider").
- SetRegistryIDs("zk").
- SetProtocol(tripleConst.TRIPLE).
- SetGeneric(true).
- SetSerialization("hessian2").
- Build()
-
-// Construct Root configuration, introducing the registry module
-rootConfig := config.NewRootConfigBuilder().
- AddRegistry("zk", config.NewRegistryConfigWithProtocolDefaultPort("zookeeper")).
- Build()
-
-// Reference configuration initialization, as service discovery requires the configured rootConfig
-if err := refConf.Init(rootConfig); err != nil{
- panic(err)
-}
-
-// Generic invocation loading, service discovery
-refConf.GenericLoad(appName)
-
-time.Sleep(time.Second)
-
-// Initiate generic invocation
-resp, err := refConf.GetRPCService().(*generic.GenericService).Invoke(
- context.TODO(),
- "getUser1",
- []string{"java.lang.String"},
- []hessian.Object{"A003"},
-)
-
-if err != nil {
- panic(err)
-}
-logger.Infof("GetUser1(userId string) res: %+v", resp)
-```
-
-The Invoke method of GenericService includes three parameters: context.Context, []string, []hessian.Object,
-
-where the second parameter corresponds to the Java class names such as java.lang.String, org.apache.dubbo.User, and the third parameter is the parameter list, hessian.Object as the interface. The second and third parameters should match the method signature in order.
-
-Obtained a map structure return result
-
-```
-INFO cmd/client.go:89 GetUser1(userId string) res: map[age:48 class:org.apache.dubbo.User id:A003 name:Joe sex:MAN time:2021-10-04 14:03:03.37 +0800 CST]
-```
diff --git a/content/en/overview/mannual/golang-sdk/refer/sourcecode/generic.md b/content/en/overview/mannual/golang-sdk/refer/sourcecode/generic.md
deleted file mode 100644
index e37eb6c31c6..00000000000
--- a/content/en/overview/mannual/golang-sdk/refer/sourcecode/generic.md
+++ /dev/null
@@ -1,108 +0,0 @@
----
-aliases:
- - /en/docs3-v2/golang-sdk/tutorial/develop/features/generic/
- - /en/docs3-v2/golang-sdk/tutorial/develop/features/generic/
-description: Generic Call
-title: Generic Call
-type: docs
-weight: 7
----
-
-
-
-
-
-
-## 1. Dubbo-go Generic Call Java Server
-
-Using Triple protocol + hessian2 serialization scheme
-
-### 1.1 Java Server Startup
-
-1. Transport Structure Definition
-
-```java
-package org.apache.dubbo;
-
-import java.io.Serializable;
-import java.util.Date;
-
-public class User implements Serializable {
- private String id;
-
- private String name;
-
- private int age;
-
- private Date time = new Date();
-}
-```
-
-2. Interface Definition
-
-```java
-package org.apache.dubbo;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-//import org.apache.dubbo.rpc.filter.GenericFilter;
-
-public interface UserProvider {
- User GetUser1(String userId);
-}
-```
-
-### 1.2 Go Client Generic Call
-
-This section shows how to construct a generic interface reference in the form of an API
-
-```go
-// Initialize Reference Configuration
-refConf := config.NewReferenceConfigBuilder().
- SetInterface("org.apache.dubbo.UserProvider").
- SetRegistryIDs("zk").
- SetProtocol(tripleConst.TRIPLE).
- SetGeneric(true).
- SetSerialization("hessian2").
- Build()
-
-// Construct Root Configuration, importing registry module
-rootConfig := config.NewRootConfigBuilder().
- AddRegistry("zk", config.NewRegistryConfigWithProtocolDefaultPort("zookeeper")).
- Build()
-
-// Reference Configuration initialization, as service discovery needs to pass in the configured rootConfig
-if err := refConf.Init(rootConfig); err != nil{
- panic(err)
-}
-
-// Generic call loading, service discovery
-refConf.GenericLoad(appName)
-
-time.Sleep(time.Second)
-
-// Initiating a generic call
-resp, err := refConf.GetRPCService().(*generic.GenericService).Invoke(
- context.TODO(),
- "getUser1",
- []string{"java.lang.String"},
- []hessian.Object{"A003"},
-)
-
-if err != nil {
- panic(err)
-}
-logger.Infof("GetUser1(userId string) res: %+v", resp)
-```
-
-The Invoke method of GenericService includes three parameters: context.Context, []string, []hessian.Object,
-
-where the second parameter is the corresponding Java class name, such as java.lang.String, org.apache.dubbo.User, and the third parameter is the parameter list, where hessian.Object is the interface. The second and third parameters should match the method signature and correspond in order.
-
-Obtain a map structure return result
-
-```
-INFO cmd/client.go:89 GetUser1(userId string) res: map[age:48 class:org.apache.dubbo.User id:A003 name:Joe sex:MAN time:2021-10-04 14:03:03.37 +0800 CST]
-```
-
diff --git a/content/en/overview/mannual/golang-sdk/refer/sourcecode/protocol.md b/content/en/overview/mannual/golang-sdk/refer/sourcecode/protocol.md
deleted file mode 100644
index d95496d74f4..00000000000
--- a/content/en/overview/mannual/golang-sdk/refer/sourcecode/protocol.md
+++ /dev/null
@@ -1,34 +0,0 @@
----
-aliases:
- - /en/docs3-v2/golang-sdk/sourcecode/protocol/
- - /en/docs3-v2/golang-sdk/sourcecode/protocol/
-description: Interpretation of Network Protocol Source Code
-title: Network Protocol
-type: docs
-weight: 1
----
-
-
-
-
-
-
-For the Dubbogo microservice framework, the network protocol is the module responsible for network communication in remote procedure calls, handling functions such as data serialization, packaging, request initiation, and network port listening from the application layer to the network layer. Dubbogo abstracts a set of interfaces for protocols as follows:
-
-```go
-type Protocol interface {
- // Export service for remote invocation
- Export(invoker Invoker) Exporter
- // Refer a remote service
- Refer(url *common.URL) Invoker
- // Destroy will destroy all invoker and exporter, so it only is called once.
- Destroy()
-}
-```
-
-This interface includes three methods. The Export method is responsible for the service exposure process. The input parameter invoker is a concept of dubbo, encapsulating a callable instance. In the specific Export method implementation for a protocol (e.g., Triple), the callable instance Invoker with certain logic is exposed to external services in the form of network port listening. Requests targeting that network port will be captured by the listening coroutine initiated by the Export [...]
-
-The Refer method handles the service reference process, with the input parameter url being a general structure in the dubbo framework that describes a desired referenced service. The url parameter includes multiple parameters for the referenced service, such as the service interface name, version number, protocol used, etc. In the specific Refer method implementation for a protocol (e.g., Triple), it encapsulates the specific network protocol within the Invoker callable instance method, [...]
-
-The Destroy method serves to destroy the currently exposed services, used in service offline scenarios. The Dubbogo framework has an elegant offline mechanism that can take down all started services in the form of listening signals before the service process terminates.
-
diff --git a/content/en/overview/mannual/golang-sdk/refer/sourcecode/registry.md b/content/en/overview/mannual/golang-sdk/refer/sourcecode/registry.md
deleted file mode 100644
index c17e41348fc..00000000000
--- a/content/en/overview/mannual/golang-sdk/refer/sourcecode/registry.md
+++ /dev/null
@@ -1,60 +0,0 @@
----
-aliases:
- - /en/docs3-v2/golang-sdk/sourcecode/registry/
- - /en/docs3-v2/golang-sdk/sourcecode/registry/
-description: Interpretation of the source code of the registry
-title: Registry
-type: docs
-weight: 1
----
-
-
-
-
-
-
-Dubbogo abstracts a set of interfaces for the registry as follows:
-
-```go
-// Registry Extension - Registry
-type Registry interface {
- common.Node
-
- // Register is used for service provider calling, register services
- // to registry. And it is also used for service consumer calling, register
- // services cared about, for dubbo's admin monitoring.
- Register(url *common.URL) error
-
- // UnRegister is required to support the contract:
- // 1. If it is the persistent stored data of dynamic=false, the
- // registration data can not be found, then the IllegalStateException
- // is thrown, otherwise it is ignored.
- // 2. Unregister according to the full url match.
- // url Registration information, is not allowed to be empty, e.g:
- // dubbo://10.20.153.10/org.apache.dubbo.foo.BarService?version=1.0.0&application=kylin
- UnRegister(url *common.URL) error
-
- // Subscribe is required to support the contract:
- // When creating new registry extension, pls select one of the
- // following modes.
- // Will remove in dubbogo version v1.1.0
- // mode1: return Listener with Next function which can return
- // subscribe service event from registry
- // Deprecated!
- // subscribe(event.URL) (Listener, error)
- // Will replace mode1 in dubbogo version v1.1.0
- // mode2: callback mode, subscribe with notify(notify listener).
- Subscribe(*common.URL, NotifyListener) error
-
- // UnSubscribe is required to support the contract:
- // 1. If don't subscribe, ignore it directly.
- // 2. Unsubscribe by full URL match.
- // url Subscription condition, not allowed to be empty, e.g.
- // consumer://10.20.153.10/org.apache.dubbo.foo.BarService?version=1.0.0&application=kylin
- // listener A listener of the change event, not allowed to be empty
- UnSubscribe(*common.URL, NotifyListener) error
-}
-```
-
-This interface mainly includes four methods: register, unregister, subscribe, and unsubscribe. As the names suggest, it summarizes the actions for client and server interactions with the registry. For general interface-level service registration scenarios, when the Provider service starts, it abstracts its service interface information into a URL, which contains all the information needed for the client to initiate a call (IP, port, protocol, etc.). The server's registry component writes [...]
-
diff --git a/content/en/overview/mannual/golang-sdk/sourcecode/3.0_feature.md b/content/en/overview/mannual/golang-sdk/sourcecode/3.0_feature.md
new file mode 100644
index 00000000000..0e05a7bc01c
--- /dev/null
+++ b/content/en/overview/mannual/golang-sdk/sourcecode/3.0_feature.md
@@ -0,0 +1,75 @@
+---
+aliases:
+ - /en/docs3-v2/golang-sdk/preface/3.0_feature/
+ - /en/overview/mannual/golang-sdk/preface/3.0_feature/
+ - /en/overview/mannual/golang-sdk/refer/sourcecode/3.0_feature/
+description: Current Dubbo Go 3.x core capabilities
+keywords: New features
+title: Core 3.x Capabilities
+type: docs
+weight: 3
+---
+
+Related samples:
+
+* Triple protocol: <a href="https://github.com/apache/dubbo-go-samples/tree/main/rpc/triple" target="_blank">dubbo-go-samples/rpc/triple</a>
+* Application-level discovery with Nacos: <a href="https://github.com/apache/dubbo-go-samples/tree/main/registry/nacos" target="_blank">dubbo-go-samples/registry/nacos</a>
+* Service Mesh deployment: <a href="https://github.com/apache/dubbo-go-samples/tree/main/mesh" target="_blank">dubbo-go-samples/mesh</a>
+
+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 "new features" from the 3.0 release; they are the normal development model for current Dubbo Go applications.
+
+## Triple Protocol
+
+Triple is the recommended RPC protocol in Dubbo Go 3.x. Its implementation lives mainly under:
+
+* `protocol/triple`
+* `protocol/triple/triple_protocol`
+* `tools/protoc-gen-go-triple`
+
+The protocol is based on HTTP/1.1 and HTTP/2 semantics and is compatible with gRPC on the wire. For protobuf-based services, users define `.proto` files, generate Go code with `protoc-gen-go` and `protoc-gen-go-triple`, then register the generated handlers with the Dubbo Go server.
+
+At runtime, the Triple protocol follows the common Dubbo protocol abstraction:
+
+* provider side: `server.Register(...)` builds service options and invokers, then protocol `Export` exposes them;
+* consumer side: generated clients call into `client.Connection`, which builds invocations and delegates to protocol `Refer` invokers;
+* metadata such as request headers, response headers, and trailers is available through Triple metadata APIs.
+
+## Application-level Service Discovery
+
+Application-level service discovery is the default discovery model in current Dubbo Go. The provider registers application instances and metadata, while the consumer resolves service-to-application mapping and uses metadata to recover callable service URLs.
+
+Important code entry points include:
+
+* `registry/options.go`: registry type options such as `WithRegisterService`, `WithRegisterInterface`, and `WithRegisterServiceAndInterface`;
+* `registry/servicediscovery`: application-level registration and subscription;
+* `metadata/report` and `metadata/mapping`: metadata report and service-name mapping;
+* `options.go`: instance-level metadata options such as `WithRemoteMetadata` and `WithMetadataServiceProtocol`.
+
+There are three registration modes:
+
+| Mode | API | Meaning |
+| --- | --- | --- |
+| `service` | `registry.WithRegisterService()` | Register application-level instances. This is the recommended default. |
+| `interface` | `registry.WithRegisterInterface()` | Register interface-level provider URLs. |
+| `all` | `registry.WithRegisterServiceAndInterface()` | Register both models during migration. |
+
+See [Application-level Service Discovery](/en/overview/mannual/golang-sdk/tutorial/service-discovery/application-level-service-discovery/) for the detailed behavior and defaults.
+
+## Metadata Modes
+
+Application-level discovery needs provider metadata. Dubbo Go supports:
+
+* local metadata: providers expose metadata through a metadata service;
+* remote metadata: providers report metadata to a metadata center, and consumers read from that center.
+
+The default metadata type is `local`. `metadata-service-protocol` defaults to `dubbo`, but can be set with `dubbo.WithMetadataServiceProtocol(...)`.
+
+## Governance and Mesh Integration
+
+Dubbo Go keeps many governance features in SDK-side extension points:
+
+* filters for cross-cutting logic such as metrics, tracing, token, generic invocation, and graceful shutdown;
+* routers for condition, tag, script, and mesh-style routing;
+* load balancers and cluster strategies for invocation selection and fault tolerance.
+
+The one-stop `imports` package imports common built-in implementations so their `init` functions register extensions with `common/extension`.
diff --git a/content/en/overview/mannual/golang-sdk/sourcecode/_index.md b/content/en/overview/mannual/golang-sdk/sourcecode/_index.md
new file mode 100644
index 00000000000..e2ea28fbf75
--- /dev/null
+++ b/content/en/overview/mannual/golang-sdk/sourcecode/_index.md
@@ -0,0 +1,14 @@
+---
+aliases:
+ - /en/docs3-v2/golang-sdk/sourcecode/
+ - /en/overview/mannual/golang-sdk/sourcecode/
+ - /en/overview/mannual/golang-sdk/refer/sourcecode/
+description: Source code guide for current Dubbo Go runtime architecture and extension points
+title: Source Code Guide
+type: docs
+weight: 5
+---
+
+This section explains the current Dubbo Go runtime from source-code entry points: architecture, protocol, registry and service discovery, generic invocation, application/interface configuration, and extension loading.
+
+Start with [Architecture](/en/overview/mannual/golang-sdk/sourcecode/architecture/) if you want the end-to-end call flow, then read the protocol, registry, and extension pages for the deeper runtime pieces.
diff --git a/content/en/overview/mannual/golang-sdk/sourcecode/aop_and_extension.md b/content/en/overview/mannual/golang-sdk/sourcecode/aop_and_extension.md
new file mode 100644
index 00000000000..1383fd4d5dd
--- /dev/null
+++ b/content/en/overview/mannual/golang-sdk/sourcecode/aop_and_extension.md
@@ -0,0 +1,114 @@
+---
+aliases:
+ - /en/docs3-v2/golang-sdk/preface/design/aop_and_extension/
+ - /en/overview/mannual/golang-sdk/preface/design/aop_and_extension/
+ - /en/overview/mannual/golang-sdk/refer/sourcecode/aop_and_extension/
+description: AOP and extension mechanism in current Dubbo Go
+keywords: AOP, extension
+title: AOP and Extension Mechanism
+type: docs
+---
+
+Related samples:
+
+* Custom filter: <a href="https://github.com/apache/dubbo-go-samples/tree/main/filter/custom" target="_blank">dubbo-go-samples/filter/custom</a>
+* Condition router: <a href="https://github.com/apache/dubbo-go-samples/tree/main/router/condition" target="_blank">dubbo-go-samples/router/condition</a>
+* Tag router: <a href="https://github.com/apache/dubbo-go-samples/tree/main/router/tag" target="_blank">dubbo-go-samples/router/tag</a>
+
+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.
+
+## Extension Registry
+
+The current implementation lives under `common/extension`. It no longer relies on ad hoc package-level maps for each type. Instead, each extension category uses the shared generic registry helper:
+
+```go
+var loadbalances = NewRegistry[func() loadbalance.LoadBalance]("loadbalance")
+
+func SetLoadbalance(name string, fcn func() loadbalance.LoadBalance) {
+ loadbalances.Register(name, fcn)
+}
+
+func GetLoadbalance(name string) loadbalance.LoadBalance {
+ return loadbalances.MustGet(name)()
+}
+```
+
+The same pattern is used for:
+
+* `common/extension/filter.go`
+* `common/extension/protocol.go`
+* `common/extension/registry.go`
+* `common/extension/router_factory.go`
+
+This gives Dubbo Go a uniform registration model and also supports helper APIs such as unregistering and listing registered names in some categories.
+
+## How `init()` Is Used
+
+Built-in implementations usually register themselves in `init()`:
+
+```go
+func init() {
+ extension.SetLoadbalance(constant.LoadBalanceKeyRandom, NewRandomLoadBalance)
+}
+```
+
+The same pattern appears across the runtime:
+
+* `protocol/triple/triple.go` registers Triple
+* `protocol/dubbo/dubbo_protocol.go` registers Dubbo
+* `protocol/rest/rest_protocol.go` registers REST
+* `registry/nacos/registry.go`, `registry/zookeeper/registry.go`, `registry/etcdv3/registry.go` register registries
+* `filter/generic/filter.go`, `filter/metrics/filter.go`, `filter/graceful_shutdown/...` register filters
+* `cluster/router/condition/factory.go`, `cluster/router/tag/factory.go`, `cluster/router/script/factory.go` register router factories
+
+Once those packages are imported, the framework can look up implementations by name.
+
+## The `imports` Package
+
+For most applications, the easiest way to load built-in implementations is:
+
+```go
+import _ "dubbo.apache.org/dubbo-go/v3/imports"
+```
+
+`imports/imports.go` is the one-stop entry that imports common built-in:
+
+* cluster strategies
+* load balancers
+* routers
+* config centers
+* filters
+* metadata report implementations
+* tracing and metrics exporters
+* protocols
+* registries
+
+If you want a smaller runtime surface, you can also import only the concrete implementation packages you need.
+
+## Custom Extensions
+
+A custom extension usually follows the same steps:
+
+1. implement the target interface;
+2. register a factory in `init()` with `common/extension`;
+3. make sure the package is imported by your application.
+
+For example:
+
+* custom filter: register with `extension.SetFilter(...)`
+* custom router factory: register with `extension.SetRouterFactory(...)`
+* custom protocol: register with `extension.SetProtocol(...)`
+* custom registry: register with `extension.SetRegistry(...)`
+
+The framework then resolves the implementation from configuration or runtime options by name.
+
+## AOP-Style Call Chains
+
+Dubbo Go uses AOP-style chaining in several core abstractions:
+
+* `filter.Filter`
+* `cluster.Router`
+* `cluster/loadbalance.LoadBalance`
+* `protocol/base.Invoker`
+
+Each implementation focuses on one concern, then participates in a larger invocation chain. This is why features such as metrics, tracing, token verification, generic invocation, and graceful shutdown can be added without changing every protocol or business handler.
diff --git a/content/en/overview/mannual/golang-sdk/sourcecode/app_and_interface.md b/content/en/overview/mannual/golang-sdk/sourcecode/app_and_interface.md
new file mode 100644
index 00000000000..6b2d3e33042
--- /dev/null
+++ b/content/en/overview/mannual/golang-sdk/sourcecode/app_and_interface.md
@@ -0,0 +1,105 @@
+---
+aliases:
+ - /en/docs3-v2/golang-sdk/preface/design/app_and_interface/
+ - /en/overview/mannual/golang-sdk/preface/design/app_and_interface/
+ - /en/overview/mannual/golang-sdk/refer/sourcecode/app_and_interface/
+description: Application-level and interface-level concepts in current Dubbo Go
+keywords: Basic concepts
+title: Application and Interface
+type: docs
+---
+
+Related samples:
+
+* Hello world application: <a href="https://github.com/apache/dubbo-go-samples/tree/main/helloworld" target="_blank">dubbo-go-samples/helloworld</a>
+* YAML-based configuration: <a href="https://github.com/apache/dubbo-go-samples/tree/main/config_yaml" target="_blank">dubbo-go-samples/config_yaml</a>
+* Registry-based application: <a href="https://github.com/apache/dubbo-go-samples/tree/main/registry/nacos" target="_blank">dubbo-go-samples/registry/nacos</a>
+
+Current Dubbo Go still separates concepts into application-level configuration and interface-level service references, but the runtime model is broader than the older "application vs interface" explanation. The real source of truth is now the application instance options in `options.go` and the compatibility configuration model in `config/root_config.go`.
+
+## Application-Level Configuration
+
+Application-level configuration is shared by all services and references inside one Dubbo Go process.
+
+In configuration-file mode, that model is represented by `config.RootConfig`:
+
+* `Application`
+* `Protocols`
+* `Registries`
+* `ConfigCenter`
+* `MetadataReport`
+* `Provider`
+* `Consumer`
+* `Otel`
+* `Metrics`
+* `Tracing`
+* `Logger`
+* `Shutdown`
+* `Router`
+* `TLSConfig`
+
+In API mode, the same shape appears in `InstanceOptions` from `options.go`, which is filled by helpers such as:
+
+* `dubbo.WithProtocol(...)`
+* `dubbo.WithRegistry(...)`
+* `dubbo.WithConfigCenter(...)`
+* `dubbo.WithMetadataReport(...)`
+* `dubbo.WithMetrics(...)`
+* `dubbo.WithTracing(...)`
+* `dubbo.WithShutdown(...)`
+* `dubbo.WithRouter(...)`
+* `dubbo.WithRemoteMetadata()`
+* `dubbo.WithMetadataServiceProtocol(...)`
+
+These options describe the runtime environment of the whole application, not one single service.
+
+## Interface-Level Configuration
+
+Interface-level configuration is attached to one exposed service or one referenced remote interface.
+
+On the provider side, the main unit is a registered service:
+
+* `server.Register(...)`
+* `server.RegisterService(...)`
+* `server.ServiceOptions`
+
+This layer carries interface name, implementation handler, protocol IDs, registry IDs, serialization, and service metadata.
+
+On the consumer side, the main unit is a reference:
+
+* generated client stubs with `client.DialWithInfo(...)`
+* plain service references with `client.DialWithService(...)`
+* generic references with `client.NewGenericService(...)`
+
+This layer carries interface name, URL or registry target, protocol selection, group/version, timeout, and per-reference routing or metadata behavior.
+
+## Why Both Levels Matter
+
+The distinction is especially important in current Dubbo Go because application-level service discovery is now common.
+
+At the application level, Dubbo Go manages:
+
+* application identity
+* registry and metadata center integration
+* protocol server/client setup
+* tracing, metrics, and logging
+* router and shutdown policies
+
+At the interface level, Dubbo Go manages:
+
+* which service is exported or referenced
+* which method signatures are callable
+* per-service protocol and registry binding
+* generic or generated invocation behavior
+
+That is why one process can expose multiple services and reference multiple remote services while still sharing the same application identity, registries, protocol servers, and governance settings.
+
+## Provider and Consumer Are Not Separate Applications
+
+A single Dubbo Go process can contain both provider and consumer roles at the same time. In practice:
+
+* one application instance may host multiple services;
+* the same application instance may also dial multiple remote services;
+* all of them share the same top-level instance options unless overridden at the service or reference layer.
+
+This is the runtime reason behind the directory and package split you see in `server`, `client`, `registry`, `metadata`, and `protocol`.
diff --git a/content/en/overview/mannual/golang-sdk/sourcecode/architecture.md b/content/en/overview/mannual/golang-sdk/sourcecode/architecture.md
new file mode 100644
index 00000000000..0040e7e9ac7
--- /dev/null
+++ b/content/en/overview/mannual/golang-sdk/sourcecode/architecture.md
@@ -0,0 +1,65 @@
+---
+aliases:
+ - /en/docs3-v2/golang-sdk/preface/design/architecture/
+ - /en/overview/mannual/golang-sdk/preface/design/architecture/
+ - /en/overview/mannual/golang-sdk/refer/sourcecode/architecture/
+description: Current Dubbo Go architecture
+keywords: Architecture
+title: Architecture
+type: docs
+weight: 1
+---
+
+Related samples:
+
+* Quick start RPC application: <a href="https://github.com/apache/dubbo-go-samples/tree/main/helloworld" target="_blank">dubbo-go-samples/helloworld</a>
+* Registry-based microservice application: <a href="https://github.com/apache/dubbo-go-samples/tree/main/registry/nacos" target="_blank">dubbo-go-samples/registry/nacos</a>
+* Multi-protocol application: <a href="https://github.com/apache/dubbo-go-samples/tree/main/rpc/multi-protocols" target="_blank">dubbo-go-samples/rpc/multi-protocols</a>
+
+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 `dubbo.go`, `server`, and `client`, while configuration-file users still go through `config.RootConfig`.
+
+## Main Runtime Layers
+
+| Layer | Important packages | Responsibility |
+| --- | --- | --- |
+| Application instance | `dubbo.go`, `options.go` | Holds application, protocol, registry, metadata, metrics, tracing, router, and shutdown options. |
+| Provider API | `server` | Registers service handlers, builds service options, creates invokers, and exports services. |
+| Consumer API | `client` | Creates clients, dials service references, creates generated or generic services, and invokes remote methods. |
+| Protocol | `protocol/base`, `protocol/triple`, `protocol/dubbo`, `protocol/rest` | Converts invokers into network servers on provider side and network clients on consumer side. |
+| Registry and discovery | `registry`, `registry/protocol`, `registry/servicediscovery`, `registry/directory` | Handles registration, subscription, service discovery, and registry-backed invocation. |
+| Metadata | `metadata`, `metadata/report`, `metadata/mapping` | Stores service definitions, service-to-application mapping, and metadata reports. |
+| Governance extensions | `filter`, `cluster`, `cluster/router`, `cluster/loadbalance`, `common/extension` | Provides filters, routing, load balancing, cluster strategies, and extension registration. |
+
+## Provider Flow
+
+For the current server API, a provider normally follows this path:
+
+1. `dubbo.NewInstance(...)` creates an application instance and initializes global options.
+2. `ins.NewServer(...)` creates a server with application, protocol, registry, and provider options.
+3. Generated code or user code calls `server.Register(...)` or `server.RegisterService(...)`.
+4. The server builds `ServiceOptions`, records service metadata, and creates an invoker.
+5. `ServiceOptions.Export()` delegates to protocol export logic.
+6. If a registry is configured, `registry/protocol` coordinates service export, registry registration, and metadata reporting.
+
+The Triple protocol implementation exports services through `protocol/triple`. The application-level discovery path registers application instances and metadata through `registry/servicediscovery`.
+
+## Consumer Flow
+
+A consumer normally follows this path:
+
+1. `dubbo.NewInstance(...)` creates an application instance.
+2. `ins.NewClient(...)` creates a client with registry, protocol, consumer, metadata, metrics, tracing, and router options.
+3. Generated clients call `client.DialWithInfo(...)`, while generic calls use `client.NewGenericService(...)`.
+4. The client builds `ReferenceOptions` and initializes metadata report if needed.
+5. Direct URLs call the target protocol directly; registry URLs go through `registry/protocol`.
+6. The registry directory receives address updates and applies routers, load balancers, and cluster logic before invoking a provider.
+
+## Extension Loading
+
+Many implementations are registered by Go package initialization. Importing:
+
+```go
+import _ "dubbo.apache.org/dubbo-go/v3/imports"
+```
+
+loads common built-in protocols, registries, filters, routers, metadata reports, tracing exporters, metrics, load balancers, and cluster strategies. Users can also import only the specific implementation packages they need.
diff --git a/content/en/overview/mannual/golang-sdk/sourcecode/generic-2.md b/content/en/overview/mannual/golang-sdk/sourcecode/generic-2.md
new file mode 100644
index 00000000000..44f02fa7f74
--- /dev/null
+++ b/content/en/overview/mannual/golang-sdk/sourcecode/generic-2.md
@@ -0,0 +1,29 @@
+---
+aliases:
+ - /en/docs3-v2/golang-sdk/tutorial/develop/features/generic-2/
+ - /en/overview/mannual/golang-sdk/refer/sourcecode/generic-2/
+description: Compatibility note for generic invocation documentation
+title: Generic Invocation Compatibility Notes
+type: docs
+weight: 8
+---
+
+Related sample:
+
+* Generic invocation sample: <a href="https://github.com/apache/dubbo-go-samples/tree/main/generic" target="_blank">dubbo-go-samples/generic</a>
+
+This page is kept mainly for compatibility with older links.
+
+For current Dubbo Go, please read [Generic Call](/en/overview/mannual/golang-sdk/sourcecode/generic/). The old examples that use:
+
+* `config.NewReferenceConfigBuilder()`
+* `GenericLoad()`
+* `GetRPCService()`
+
+describe the legacy configuration-centric API path. The recommended runtime entry today is:
+
+* `client.NewGenericService(...)`
+* `filter/generic.GenericService.Invoke(...)`
+* `filter/generic.GenericService.InvokeWithType(...)`
+
+If you need a working example, use the `dubbo-go-samples/generic` sample first.
diff --git a/content/en/overview/mannual/golang-sdk/sourcecode/generic.md b/content/en/overview/mannual/golang-sdk/sourcecode/generic.md
new file mode 100644
index 00000000000..5da98a86806
--- /dev/null
+++ b/content/en/overview/mannual/golang-sdk/sourcecode/generic.md
@@ -0,0 +1,90 @@
+---
+aliases:
+ - /en/docs3-v2/golang-sdk/tutorial/develop/features/generic/
+ - /en/overview/mannual/golang-sdk/refer/sourcecode/generic/
+ - /en/overview/mannual/golang-sdk/tutorial/develop/features/generic/
+description: Generic invocation in current Dubbo Go
+title: Generic Call
+type: docs
+weight: 7
+---
+
+Related samples:
+
+* Generic invocation sample: <a href="https://github.com/apache/dubbo-go-samples/tree/main/generic" target="_blank">dubbo-go-samples/generic</a>
+* Triple sample: <a href="https://github.com/apache/dubbo-go-samples/tree/main/rpc/triple" target="_blank">dubbo-go-samples/rpc/triple</a>
+
+Generic invocation in current Dubbo Go is centered on `client.NewGenericService(...)` and `filter/generic.GenericService`. Older examples based on `ReferenceConfigBuilder`, `GenericLoad()`, and `GetRPCService()` describe the legacy compatibility API and are no longer the recommended entry point.
+
+## Core API
+
+The main runtime entry is in `client/client.go`:
+
+```go
+genericService, err := cli.NewGenericService(
+ "org.apache.dubbo.samples.UserProvider",
+ client.WithProtocolTriple(),
+ client.WithSerialization(constant.Hessian2Serialization),
+ client.WithURL("tri://127.0.0.1:20000"),
+)
+```
+
+`NewGenericService(...)` does three important things by default:
+
+* sets `NONIDL`
+* enables generic invocation
+* uses `hessian2` serialization
+
+Internally it creates `filter/generic.GenericService`, then wires it into the normal reference and invocation path.
+
+## GenericService
+
+The core type is:
+
+```go
+type GenericService struct {
+ Invoke func(ctx context.Context, methodName string, types []string, args []hessian.Object) (any, error) `dubbo:"$invoke"`
+}
+```
+
+This mirrors the generic invocation model used by Dubbo: you provide:
+
+* method name
+* parameter type names
+* argument list
+
+and the framework sends a generic `$invoke` request to the remote service.
+
+## Typed Result Helper
+
+Current Dubbo Go also provides `InvokeWithType(...)`:
+
+```go
+var user User
+err := genericService.InvokeWithType(
+ ctx,
+ "getUser",
+ []string{"java.lang.String"},
+ []hessian.Object{"123"},
+ &user,
+)
+```
+
+This helper deserializes the generic result into a concrete Go reply object. It is useful when you still want generic transport behavior but do not want to manually convert the returned map structure.
+
+## Typical Scenarios
+
+Generic invocation is usually used when:
+
+* the caller does not have generated stubs
+* the caller wants to invoke services dynamically by interface and method name
+* the caller is interacting with Java Dubbo services using generic payloads
+* migration or testing requires a dynamic client
+
+For Triple plus Hessian2 compatibility scenarios, the `generic` sample is the best place to look first.
+
+## Relation to the Generic Filter
+
+The implementation is not only a client helper. It is also connected to the generic filter chain under `filter/generic`, where Dubbo Go handles generic invocation encoding, decoding, and service-side adaptation.
+
+That is why this feature belongs both to client APIs and to the framework's filter-based extension model.
diff --git a/content/en/overview/mannual/golang-sdk/sourcecode/protocol.md b/content/en/overview/mannual/golang-sdk/sourcecode/protocol.md
new file mode 100644
index 00000000000..808690484fd
--- /dev/null
+++ b/content/en/overview/mannual/golang-sdk/sourcecode/protocol.md
@@ -0,0 +1,105 @@
+---
+aliases:
+ - /en/docs3-v2/golang-sdk/sourcecode/protocol/
+ - /en/overview/mannual/golang-sdk/refer/sourcecode/protocol/
+description: Current network protocol source code overview
+title: Network Protocol
+type: docs
+weight: 1
+---
+
+Related samples:
+
+* Triple RPC: <a href="https://github.com/apache/dubbo-go-samples/tree/main/rpc/triple" target="_blank">dubbo-go-samples/rpc/triple</a>
+* Multi-protocol service: <a href="https://github.com/apache/dubbo-go-samples/tree/main/rpc/multi-protocols" target="_blank">dubbo-go-samples/rpc/multi-protocols</a>
+* gRPC interoperability: <a href="https://github.com/apache/dubbo-go-samples/tree/main/rpc/grpc" target="_blank">dubbo-go-samples/rpc/grpc</a>
+
+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.
+
+## Core Protocol Abstraction
+
+The current protocol interface is defined in `protocol/base/base_protocol.go`:
+
+```go
+type Protocol interface {
+ Export(invoker Invoker) Exporter
+ Refer(url *common.URL) Invoker
+ Destroy()
+}
+```
+
+Its responsibilities are straightforward:
+
+* `Export`: expose a provider-side invoker as a network service
+* `Refer`: create a consumer-side invoker for a target URL
+* `Destroy`: destroy protocol-owned invokers and exporters
+
+There is also an optional capability:
+
+```go
+type RegistryUnregisterer interface {
+ UnregisterRegistries()
+}
+```
+
+which is used during graceful shutdown so a protocol can unregister exported services from registries before full teardown.
+
+## Provider-Side Flow
+
+On the provider side, Dubbo Go usually follows this path:
+
+1. `server.Register(...)` or `server.RegisterService(...)` creates service metadata and an invoker.
+2. `ServiceOptions.Export()` selects protocol and registry behavior.
+3. The concrete protocol implementation calls `Export(invoker)`.
+4. The exported service starts listening on the configured network endpoint.
+
+Different protocols provide different transports and codecs, but they all fit into the same `Export` contract.
+
+## Consumer-Side Flow
+
+On the consumer side:
+
+1. `client.Dial...(...)` builds a reference.
+2. A direct URL or registry URL is resolved.
+3. The chosen protocol implementation calls `Refer(url)`.
+4. The returned invoker becomes the callable object behind generated stubs or generic calls.
+
+This is why the protocol layer is shared by both generated clients and registry-driven references.
+
+## Built-In Protocols
+
+Common built-in implementations include:
+
+* `protocol/triple`
+* `protocol/dubbo`
+* `protocol/rest`
+* `protocol/jsonrpc`
+
+Triple is the recommended protocol for new applications. It supports unary and streaming calls, metadata headers and trailers, reflection, and gRPC interoperability on the wire.
+
+`rpc/multi-protocols` is a good sample to read when you want to see how one application exposes multiple protocol endpoints at the same time.
+
+## Registry Protocol Wrapper
+
+Dubbo Go also has a registry-backed protocol layer under `registry/protocol`.
+
+This wrapper coordinates:
+
+* service export
+* service registration
+* metadata report
+* subscription and directory refresh
+
+So in practice, many service references are not "protocol only"; they are "registry protocol + concrete business protocol".
+
+## Filtered Protocol Chain
+
+The raw protocol implementation is often wrapped again through `protocol/protocolwrapper`, especially for filter chaining. That makes protocol invocation one of the main integration points for cross-cutting behaviors such as:
+
+* tracing
+* metrics
+* token/auth checks
+* generic invocation support
+* graceful shutdown
+
+This layered structure is why the protocol package is small at the interface level but very important in the runtime call path.
diff --git a/content/en/overview/mannual/golang-sdk/sourcecode/registry.md b/content/en/overview/mannual/golang-sdk/sourcecode/registry.md
new file mode 100644
index 00000000000..642fd64f6e0
--- /dev/null
+++ b/content/en/overview/mannual/golang-sdk/sourcecode/registry.md
@@ -0,0 +1,111 @@
+---
+aliases:
+ - /en/docs3-v2/golang-sdk/sourcecode/registry/
+ - /en/overview/mannual/golang-sdk/refer/sourcecode/registry/
+description: Current registry and service discovery source code overview
+title: Registry
+type: docs
+weight: 1
+---
+
+Related samples:
+
+* Nacos registry: <a href="https://github.com/apache/dubbo-go-samples/tree/main/registry/nacos" target="_blank">dubbo-go-samples/registry/nacos</a>
+* Zookeeper registry: <a href="https://github.com/apache/dubbo-go-samples/tree/main/registry/zookeeper" target="_blank">dubbo-go-samples/registry/zookeeper</a>
+* Application-level service discovery: <a href="https://github.com/apache/dubbo-go-samples/tree/main/registry/nacos" target="_blank">dubbo-go-samples/registry/nacos</a>
+
+Related documentation:
+
+* [Application-level Service Discovery](/en/overview/mannual/golang-sdk/tutorial/service-discovery/application-level-service-discovery/)
+
+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.
+
+## Core Registry Interface
+
+The main interface is defined in `registry/registry.go`:
+
+```go
+type Registry interface {
+ common.Node
+ Register(url *common.URL) error
+ UnRegister(url *common.URL) error
+ Subscribe(*common.URL, NotifyListener) error
+ UnSubscribe(*common.URL, NotifyListener) error
+ LoadSubscribeInstances(*common.URL, NotifyListener) error
+}
+```
+
+Compared with older explanations, `LoadSubscribeInstances(...)` 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.
+
+## Current Responsibilities
+
+The registry layer now covers several related responsibilities:
+
+* provider registration and unregister
+* consumer subscription and unsubscribe
+* initial instance loading before async updates
+* application-level service discovery
+* registry-backed metadata report integration
+
+In source layout, the main related packages are:
+
+* `registry`
+* `registry/protocol`
+* `registry/servicediscovery`
+* `registry/directory`
+
+## Registration Modes
+
+Current Dubbo Go supports multiple registration models through `registry/options.go`:
+
+* `registry.WithRegisterService()`
+* `registry.WithRegisterInterface()`
+* `registry.WithRegisterServiceAndInterface()`
+
+These correspond to:
+
+* `service`: register application-level instances
+* `interface`: register interface-level provider URLs
+* `all`: register both during migration
+
+This is one of the biggest differences from older Dubbo Go documentation, which mostly described only interface-level registration.
+
+## Provider and Consumer Flow
+
+At a high level:
+
+1. A provider exports a service through `server` and `protocol`.
+2. If registry integration is enabled, `registry/protocol` coordinates registration and metadata reporting.
+3. A consumer references a service through a registry URL or registry config.
+4. `registry/directory` receives address updates and maintains the effective provider list.
+5. Routers, load balancers, and cluster logic consume that list during invocation.
+
+With application-level discovery, the consumer may first resolve service-to-application mapping and then recover concrete callable endpoints through metadata.
+
+## Built-In Registries and Extension Loading
+
+Built-in implementations are registered through package initialization:
+
+* `registry/nacos`
+* `registry/zookeeper`
+* `registry/etcdv3`
+* `registry/polaris`
+* `registry/servicediscovery`
+
+They are exposed through `common/extension.SetRegistry(...)` and commonly loaded through:
+
+```go
+import _ "dubbo.apache.org/dubbo-go/v3/imports"
+```
+
+## Registry Configuration Shape
+
+In API mode, registries are configured with:
+
+* `dubbo.WithRegistry(...)` at instance level
+* `client.WithRegistry(...)` or `client.WithRegistryIDs(...)` on references
+* `server.WithRegistry(...)` or `server.WithRegistryIDs(...)` on services
+
+In configuration-file mode, registries live under `RootConfig.Registries`.
+
+That split explains why the registry layer appears both as a top-level application concern and as a per-service or per-reference selector.
diff --git a/content/en/overview/mannual/golang-sdk/tools/_index.md b/content/en/overview/mannual/golang-sdk/tools/_index.md
new file mode 100644
index 00000000000..2d2e48d9831
--- /dev/null
+++ b/content/en/overview/mannual/golang-sdk/tools/_index.md
@@ -0,0 +1,8 @@
+---
+aliases:
+ - /en/overview/mannual/golang-sdk/refer/tools/
+description: "Tools used when developing Dubbo Go applications, including scaffolding, code generation, and debugging utilities."
+title: Tools
+type: docs
+weight: 4
+---
diff --git a/content/en/overview/mannual/golang-sdk/refer/use_dubbogo_cli.md b/content/en/overview/mannual/golang-sdk/tools/dubbogo-cli.md
similarity index 89%
rename from content/en/overview/mannual/golang-sdk/refer/use_dubbogo_cli.md
rename to content/en/overview/mannual/golang-sdk/tools/dubbogo-cli.md
index 1a411a92435..390e96d34db 100644
--- a/content/en/overview/mannual/golang-sdk/refer/use_dubbogo_cli.md
+++ b/content/en/overview/mannual/golang-sdk/tools/dubbogo-cli.md
@@ -2,25 +2,36 @@
aliases:
- /en/docs3-v2/golang-sdk/refer/use_dubbogo_cli/
- /en/docs3-v2/golang-sdk/refer/use_dubbogo_cli/
+ - /en/overview/mannual/golang-sdk/refer/use_dubbogo_cli/
description: Using the dubbogo-cli Tool
title: Using the dubbogo-cli Tool
type: docs
-weight: 3
+weight: 1
---
-{{% alert title="Deprecation Warning" color="warning" %}}
-Starting from version 3.1.0 of dubbo-go, this tool is no longer applicable. This tool has been discontinued and will be replaced by dubboctl in the future. Please stay updated with community news to learn about the latest developments of dubboctl.
-{{% /alert %}}
## 1. Installation
-dubbogo-cli is a subproject of the Apache/dubbo-go ecosystem, providing convenient application template creation, tool installation, interface debugging, and other functions to improve developer efficiency.
+dubbogo-cli is maintained inside the Apache dubbo-go repository under
+[`tools/dubbogo-cli`](https://github.com/apache/dubbo-go/tree/main/tools/dubbogo-cli). It provides convenient
+application template creation, tool installation, interface debugging, and other functions to improve developer
+efficiency.
-To install dubbogo-cli to $GOPATH/bin, run the following command:
+Install `protoc-gen-go` first:
```
-go install github.com/dubbogo/dubbogo-cli@latest
+go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
+```
+
+Then install `dubbogo-cli` from the dubbo-go repository:
+
+```bash
+git clone --depth 1 https://github.com/apache/dubbo-go.git
+cd dubbo-go/tools/dubbogo-cli
+go install .
```
+Make sure your `GOBIN` or `GOPATH/bin` is in `PATH` so that `dubbogo-cli` can be executed directly.
+
## 2. Feature Overview
dubbogo-cli supports the following capabilities:
@@ -47,11 +58,11 @@ dubbogo-cli supports the following capabilities:
dubbogo-cli install all
```
- Installs the following tools to $GOPATH/bin with one click:
+ Installs the following tools to `$GOPATH/bin` with one command:
- protoc-gen-go-triple
- For compiling triple protocol interfaces.
+ For compiling Triple protocol interfaces.
- imports-formatter
@@ -77,6 +88,11 @@ dubbogo-cli supports the following capabilities:
- Debug Triple protocol interfaces
+{{% alert title="Note" color="primary" %}}
+`dubbogo-cli install all` manages companion tools such as `protoc-gen-go-triple`, but the CLI itself should be installed
+from `tools/dubbogo-cli` as shown above.
+{{% /alert %}}
+
## 3. Feature Details
### 3.1 Demo Application Introduction
@@ -235,11 +251,12 @@ image:
The grpc_cli tool is used in the gRPC ecosystem for debugging services. When the server enables [reflection service](https://github.com/grpc/grpc/blob/master/doc/server-reflection.md), you can obtain the service's proto file, service name, method name, parameter list, and initiate gRPC calls.
-The Triple protocol is compatible with the gRPC ecosystem, and gRPC reflection service is enabled by default, so you can directly use grpc_cli to debug triple services.
+The Triple protocol is compatible with the gRPC ecosystem. When you use the standard Dubbo Go SDK Triple provider
+setup, the framework auto-registers the reflection service, so you can directly use grpc_cli to debug Triple services.
#### 3.3.2 Installing grpc_cli
-> It will be installed by dubbogo-cli in the future, but currently, users need to install it manually.
+> `grpc_cli` is not installed by `dubbogo-cli`; install it manually when you need gRPC/Triple debugging.
Refer to the [grpc_cli documentation](https://github.com/grpc/grpc/blob/master/doc/command_line_tool.md).
@@ -429,4 +446,3 @@ req:&main.CallUserStruct{ID:"A000", Male:true, SubInfo:main.SubInfo{SubID:"A001"
```
You can see that the CLI data was received.
-
diff --git a/content/en/overview/mannual/golang-sdk/tutorial/deploy2/_index.md b/content/en/overview/mannual/golang-sdk/tutorial/deployment/_index.md
similarity index 86%
rename from content/en/overview/mannual/golang-sdk/tutorial/deploy2/_index.md
rename to content/en/overview/mannual/golang-sdk/tutorial/deployment/_index.md
index 94f4cd2aa6c..20d0bff89f0 100644
--- a/content/en/overview/mannual/golang-sdk/tutorial/deploy2/_index.md
+++ b/content/en/overview/mannual/golang-sdk/tutorial/deployment/_index.md
@@ -2,10 +2,9 @@
aliases:
- /en/docs3-v2/golang-sdk/tutorial/governance/service-mesh/
- /en/docs3-v2/golang-sdk/tutorial/governance/service-mesh/
+ - /en/overview/mannual/golang-sdk/tutorial/deploy2/
description: "Learn how to deploy dubbo-go applications in scenarios such as Kubernetes, Service Mesh (Kubernetes Service), and virtual machines (Zookeeper, Nacos)."
title: Deploying Applications
type: docs
weight: 100
-toc_hide: true
---
-
diff --git a/content/en/overview/mannual/golang-sdk/tutorial/deploy2/deploy.md b/content/en/overview/mannual/golang-sdk/tutorial/deployment/deploy.md
similarity index 95%
rename from content/en/overview/mannual/golang-sdk/tutorial/deploy2/deploy.md
rename to content/en/overview/mannual/golang-sdk/tutorial/deployment/deploy.md
index 487a1b6ee89..11744c45a13 100644
--- a/content/en/overview/mannual/golang-sdk/tutorial/deploy2/deploy.md
+++ b/content/en/overview/mannual/golang-sdk/tutorial/deployment/deploy.md
@@ -2,6 +2,7 @@
aliases:
- /en/docs3-v2/golang-sdk/tutorial/governance/service-mesh/deploy/
- /en/docs3-v2/golang-sdk/tutorial/governance/service-mesh/deploy/
+ - /en/overview/mannual/golang-sdk/tutorial/deploy2/deploy/
description: Deploying Dubbo-go application in Istio environment
title: Deploying Dubbo-go application in Istio environment
type: docs
@@ -10,9 +11,14 @@ weight: 2
In this chapter, we will quickly create a set of Dubbo-go Server and Client applications using the application template and deploy them in an Istio cluster; observe, debug, and verify service discovery and successful calls.
+The matching mesh sample is available at
+<a href="https://github.com/apache/dubbo-go-samples/tree/main/mesh" target="_blank">dubbo-go-samples/mesh</a>.
+
## 1. Preparation
-- The dubbo-go CLI tool and dependency tools are installed, grpc_cli (for local debugging if needed).
+- `dubbogo-cli` and related dependency tools are installed. Install `dubbogo-cli` from
+ [`tools/dubbogo-cli`](../../../tools/dubbogo-cli/) in the dubbo-go repository. `grpc_cli` is optional for local
+ debugging.
- The docker, helm, and kubectl environments are installed. (Arm machines must support docker buildx)
- The task [Deployment of Istio Environment](../istio/) is complete.
@@ -58,6 +64,9 @@ $ tree .
└── service.go
```
+`dubbogo-cli` is maintained in the dubbo-go repository under `tools/dubbogo-cli`, and the generated template is the
+starting point for the rest of this guide.
+
The generated project includes several directories:
- api: stores interface files: proto files and generated pb.go files
@@ -101,7 +110,7 @@ The generated project includes several directories:
- Pull dependencies
```bash
- $ go get dubbo.apache.org/dubbo-go/v3@3.0
+ $ go get dubbo.apache.org/dubbo-go/v3@v3.3.1
$ make tidy
go mod tidy
```
@@ -425,4 +434,3 @@ Verify the call was successful.
The application templates provided by dubbogo-cli conveniently support developers in image building, pushing, and deployment.
In the Istio environment, server applications register their service information on Istio, while clients listen to xds resources, querying the Istio debug port for interface-level service discovery. Developers do not need to worry about concepts like service names, hostnames, and cluster names; they only need to import interfaces and initiate calls.
-
diff --git a/content/en/overview/mannual/golang-sdk/tutorial/deploy2/graceful_shutdown.md b/content/en/overview/mannual/golang-sdk/tutorial/deployment/graceful_shutdown.md
similarity index 95%
rename from content/en/overview/mannual/golang-sdk/tutorial/deploy2/graceful_shutdown.md
rename to content/en/overview/mannual/golang-sdk/tutorial/deployment/graceful_shutdown.md
index dc71840235f..10969f744ec 100644
--- a/content/en/overview/mannual/golang-sdk/tutorial/deploy2/graceful_shutdown.md
+++ b/content/en/overview/mannual/golang-sdk/tutorial/deployment/graceful_shutdown.md
@@ -2,6 +2,7 @@
aliases:
- /en/docs3-v2/golang-sdk/tutorial/governance/traffic/graceful_shutdown/
- /en/docs3-v2/golang-sdk/tutorial/governance/traffic/graceful_shutdown/
+ - /en/overview/mannual/golang-sdk/tutorial/deploy2/graceful_shutdown/
description: This article primarily introduces the basic steps and usage instructions for graceful shutdown.
keywords: Graceful Shutdown
title: Graceful Shutdown
@@ -10,6 +11,8 @@ type: docs
# Graceful Shutdown
+Sample source: <a href="https://github.com/apache/dubbo-go-samples/tree/main/graceful_shutdown" target="_blank">dubbo-go-samples/graceful_shutdown</a>.
+
## Background
In a stable production environment, container scheduling is fully managed by k8s, and microservice governance is maintained and managed by the service framework or operations personnel. In scenarios like releasing a new version or scaling up/down, old container instances will be terminated and replaced with new ones. If this replacement process is not handled properly in high-traffic online production environments, it can lead to a large number of erroneous requests in a short time, trig [...]
@@ -63,4 +66,3 @@ extension.AddCustomShutdownCallback(func() {
## References
[【Dubbo-go Elegant Up and Down Design and Practice】](https://developer.aliyun.com/article/860775)
-
diff --git a/content/en/overview/mannual/golang-sdk/tutorial/deploy2/istio.md b/content/en/overview/mannual/golang-sdk/tutorial/deployment/istio.md
similarity index 94%
rename from content/en/overview/mannual/golang-sdk/tutorial/deploy2/istio.md
rename to content/en/overview/mannual/golang-sdk/tutorial/deployment/istio.md
index 4947bd427c3..20f60a984b8 100644
--- a/content/en/overview/mannual/golang-sdk/tutorial/deploy2/istio.md
+++ b/content/en/overview/mannual/golang-sdk/tutorial/deployment/istio.md
@@ -2,6 +2,7 @@
aliases:
- /en/docs3-v2/golang-sdk/tutorial/governance/service-mesh/istio/
- /en/docs3-v2/golang-sdk/tutorial/governance/service-mesh/istio/
+ - /en/overview/mannual/golang-sdk/tutorial/deploy2/istio/
description: Deploying Istio Environment
title: Deploying Istio Environment
type: docs
diff --git a/content/en/overview/mannual/golang-sdk/tutorial/deploy2/proxyless_service_mesh.md b/content/en/overview/mannual/golang-sdk/tutorial/deployment/proxyless_service_mesh.md
similarity index 94%
rename from content/en/overview/mannual/golang-sdk/tutorial/deploy2/proxyless_service_mesh.md
rename to content/en/overview/mannual/golang-sdk/tutorial/deployment/proxyless_service_mesh.md
index e517a06bccc..f4221eb67ab 100644
--- a/content/en/overview/mannual/golang-sdk/tutorial/deploy2/proxyless_service_mesh.md
+++ b/content/en/overview/mannual/golang-sdk/tutorial/deployment/proxyless_service_mesh.md
@@ -2,16 +2,14 @@
aliases:
- /en/docs3-v2/golang-sdk/tutorial/governance/service-mesh/proxyless_service_mesh/
- /en/docs3-v2/golang-sdk/tutorial/governance/service-mesh/proxyless_service_mesh/
+ - /en/overview/mannual/golang-sdk/tutorial/deploy2/proxyless_service_mesh/
description: Proxyless Service Mesh
keywords: Proxyless Service Mesh
title: Proxyless Service Mesh
type: docs
---
-
-
-
-
+Sample source: <a href="https://github.com/apache/dubbo-go-samples/tree/main/mesh" target="_blank">dubbo-go-samples/mesh</a>.
## 1. What is Proxyless Service-Mesh?
@@ -82,9 +80,11 @@ Dubbo-go has routing capabilities; through the xds protocol, clients subscribe t
#### Cloud-Native Scaffolding
-dubbogo-cli is a sub-project of the Apache/dubbo-go ecosystem, providing developers with convenient functions like application template creation, tool installation, and interface debugging to enhance user development efficiency.
+dubbogo-cli is maintained inside the Apache dubbo-go repository under `tools/dubbogo-cli`. It provides convenient
+functions such as application template creation, tool installation, and interface debugging to improve developer
+efficiency.
-For details, please refer to [【dubbogo-cli tool】](/en/overview/mannual/golang-sdk/refer/use_dubbogo_cli/)
+For details, please refer to [【dubbogo-cli tool】](/en/overview/mannual/golang-sdk/tools/dubbogo-cli/)
## 3. Advantages of Dubbo-go-Mesh
@@ -114,4 +114,3 @@ Dubbo-go is a service framework that spans multiple ecosystems.
- Multi-language advantages enable interoperability between go-java applications.
- Compatible with Pixiu gateway, facilitating service exposure and protocol conversion.
- Utilizes components from the Dubbo-go ecosystem.
-
diff --git a/content/en/overview/mannual/golang-sdk/tutorial/deploy2/traffic_management.md b/content/en/overview/mannual/golang-sdk/tutorial/deployment/traffic_management.md
similarity index 96%
rename from content/en/overview/mannual/golang-sdk/tutorial/deploy2/traffic_management.md
rename to content/en/overview/mannual/golang-sdk/tutorial/deployment/traffic_management.md
index f93480d280e..5dc571aaffe 100644
--- a/content/en/overview/mannual/golang-sdk/tutorial/deploy2/traffic_management.md
+++ b/content/en/overview/mannual/golang-sdk/tutorial/deployment/traffic_management.md
@@ -2,24 +2,25 @@
aliases:
- /en/docs3-v2/golang-sdk/tutorial/governance/service-mesh/traffic_management/
- /en/docs3-v2/golang-sdk/tutorial/governance/service-mesh/traffic_management/
+ - /en/overview/mannual/golang-sdk/tutorial/deploy2/traffic_management/
description: Traffic Management
title: Traffic Management
type: docs
weight: 3
---
-
-
-
-
-
In this section, we will continue from the previous task [【Deploying Dubbo-go Applications in Istio Environment】](../deploy/).
In the previous task, we deployed a set of Dubbo-go Server and Client applications in the cluster and verified that service discovery and invocation were successful. In this section, we will create a new version of the server application. By configuring VirtualService and DestinationRule, we will achieve routing management and traffic shifting capabilities.
+The matching traffic-management manifests are available at
+<a href="https://github.com/apache/dubbo-go-samples/tree/main/mesh/deploy/traffic" target="_blank">dubbo-go-samples/mesh/deploy/traffic</a>.
+
## 1. Preparation
-- The dubbo-go CLI tool and dependencies have been installed, as well as grpc_cli (for local debugging if needed).
+- `dubbogo-cli` and related dependency tools are installed. Install `dubbogo-cli` from
+ [`tools/dubbogo-cli`](../../../tools/dubbogo-cli/) in the dubbo-go repository. `grpc_cli` is optional for local
+ debugging.
- Docker, Helm, and kubectl environments have been installed. (Arm machines need to support docker buildx)
- The task [【Deploying Dubbo-go Applications in Istio Environment】](../deploy/) has been completed.
@@ -418,4 +419,3 @@ $ kubectl get pods | grep client | awk '{print $1}' | xargs kubectl logs
2022-04-07T05:56:02.053Z INFO cmd/app.go:35 call server response = name:"Hello laurence" id:"v1.0.0"
2022-04-07T05:56:03.055Z INFO cmd/app.go:35 call server response = name:"Hello laurence" id:"v1.0.0"
```
-
diff --git a/content/en/overview/mannual/golang-sdk/tutorial/interoperability/_index.md b/content/en/overview/mannual/golang-sdk/tutorial/interoperability/_index.md
new file mode 100644
index 00000000000..e1db38b99bd
--- /dev/null
+++ b/content/en/overview/mannual/golang-sdk/tutorial/interoperability/_index.md
@@ -0,0 +1,6 @@
+---
+description: "Interoperate with Dubbo Java, gRPC, and other RPC ecosystems."
+title: Interoperability
+type: docs
+weight: 90
+---
diff --git a/content/en/overview/mannual/golang-sdk/tutorial/interop-dubbo/_index.md b/content/en/overview/mannual/golang-sdk/tutorial/interoperability/dubbo-java/_index.md
similarity index 84%
rename from content/en/overview/mannual/golang-sdk/tutorial/interop-dubbo/_index.md
rename to content/en/overview/mannual/golang-sdk/tutorial/interoperability/dubbo-java/_index.md
index 5ce27e6c8f0..dafe15d2115 100755
--- a/content/en/overview/mannual/golang-sdk/tutorial/interop-dubbo/_index.md
+++ b/content/en/overview/mannual/golang-sdk/tutorial/interoperability/dubbo-java/_index.md
@@ -3,9 +3,9 @@ aliases:
- /en/docs3-v2/golang-sdk/tutorial/debugging/
- /en/docs3-v2/golang-sdk/tutorial/debugging/
- /en/overview/mannual/golang-sdk/tutorial/develop/interflow/call_java/
+ - /en/overview/mannual/golang-sdk/tutorial/interop-dubbo/
description: "Implementing interoperability between Dubbo Go and Dubbo Java applications, including service discovery, protocol communication, etc."
title: Interoperability with Dubbo Java
type: docs
-weight: 90
+weight: 1
---
-
diff --git a/content/en/overview/mannual/golang-sdk/tutorial/interop-dubbo/call_java_protocol_dubbo_non_protobuf.md b/content/en/overview/mannual/golang-sdk/tutorial/interoperability/dubbo-java/call_java_protocol_dubbo_non_protobuf.md
similarity index 96%
rename from content/en/overview/mannual/golang-sdk/tutorial/interop-dubbo/call_java_protocol_dubbo_non_protobuf.md
rename to content/en/overview/mannual/golang-sdk/tutorial/interoperability/dubbo-java/call_java_protocol_dubbo_non_protobuf.md
index 5af6a3e18ba..1efde30d0ac 100644
--- a/content/en/overview/mannual/golang-sdk/tutorial/interop-dubbo/call_java_protocol_dubbo_non_protobuf.md
+++ b/content/en/overview/mannual/golang-sdk/tutorial/interoperability/dubbo-java/call_java_protocol_dubbo_non_protobuf.md
@@ -2,6 +2,7 @@
aliases:
- /en/docs3-v2/golang-sdk/tutorial/develop/interflow/call_java/
- /en/docs3-v2/golang-sdk/tutorial/develop/interflow/call_java/
+ - /en/overview/mannual/golang-sdk/tutorial/interop-dubbo/call_java_protocol_dubbo_non_protobuf/
description: "If you are an old user of Dubbo Java, your Dubbo Java application may not be using Protobuf (defining services directly using Java interfaces). In this case, you need to develop the Dubbo Go-client as follows to call the older version of Dubbo services."
title: Non-Protobuf Mode Protocol Interoperability (Applicable to Old Version Dubbo Java Applications)
linkTitle: Non-Protobuf Mode Protocol Interoperability
diff --git a/content/en/overview/mannual/golang-sdk/tutorial/interop-dubbo/call_java_protocol_triple_protobuf.md b/content/en/overview/mannual/golang-sdk/tutorial/interoperability/dubbo-java/call_java_protocol_triple_protobuf.md
similarity index 97%
rename from content/en/overview/mannual/golang-sdk/tutorial/interop-dubbo/call_java_protocol_triple_protobuf.md
rename to content/en/overview/mannual/golang-sdk/tutorial/interoperability/dubbo-java/call_java_protocol_triple_protobuf.md
index 5ffbd92d678..6a96ebc8d05 100644
--- a/content/en/overview/mannual/golang-sdk/tutorial/interop-dubbo/call_java_protocol_triple_protobuf.md
+++ b/content/en/overview/mannual/golang-sdk/tutorial/interoperability/dubbo-java/call_java_protocol_triple_protobuf.md
@@ -2,6 +2,7 @@
aliases:
- /en/docs3-v2/golang-sdk/tutorial/develop/interflow/call_java/
- /en/docs3-v2/golang-sdk/tutorial/develop/interflow/call_java/
+ - /en/overview/mannual/golang-sdk/tutorial/interop-dubbo/call_java_protocol_triple_protobuf/
description: “Realization of intercommunication between dubbo-java and dubbo-go using the triple protocol based on protobuf.”
title: Intercommunication of the triple protocol based on protobuf (suitable for scenarios developed with protobuf on both sides)
linkTitle: protobuf+triple protocol intercommunication
diff --git a/content/en/overview/mannual/golang-sdk/tutorial/interop-dubbo/service-discovery.md b/content/en/overview/mannual/golang-sdk/tutorial/interoperability/dubbo-java/service-discovery.md
similarity index 95%
rename from content/en/overview/mannual/golang-sdk/tutorial/interop-dubbo/service-discovery.md
rename to content/en/overview/mannual/golang-sdk/tutorial/interoperability/dubbo-java/service-discovery.md
index 40b2efebff2..2c3c5c965f2 100644
--- a/content/en/overview/mannual/golang-sdk/tutorial/interop-dubbo/service-discovery.md
+++ b/content/en/overview/mannual/golang-sdk/tutorial/interoperability/dubbo-java/service-discovery.md
@@ -1,4 +1,6 @@
---
+aliases:
+ - /en/overview/mannual/golang-sdk/tutorial/interop-dubbo/service-discovery/
description: "dubbo-java and dubbo-go use the same service discovery model. This document demonstrates how to achieve address interoperability based on application-level service discovery."
title: Achieving Address Interoperability Based on Application-Level Service Discovery
linkTitle: Service Discovery Achieves Address Interoperability
diff --git a/content/en/overview/mannual/golang-sdk/tutorial/interop-grpc/_index.md b/content/en/overview/mannual/golang-sdk/tutorial/interoperability/grpc/_index.md
similarity index 82%
rename from content/en/overview/mannual/golang-sdk/tutorial/interop-grpc/_index.md
rename to content/en/overview/mannual/golang-sdk/tutorial/interoperability/grpc/_index.md
index 234da92ca2c..93552bdb39e 100755
--- a/content/en/overview/mannual/golang-sdk/tutorial/interop-grpc/_index.md
+++ b/content/en/overview/mannual/golang-sdk/tutorial/interoperability/grpc/_index.md
@@ -3,9 +3,9 @@ aliases:
- /en/docs3-v2/golang-sdk/tutorial/debugging/
- /en/docs3-v2/golang-sdk/tutorial/debugging/
- /en/overview/mannual/golang-sdk/tutorial/debugging/grpc_cli/
+ - /en/overview/mannual/golang-sdk/tutorial/interop-grpc/
description: "Implement interoperability between Dubbo Go and the official Google version of the gRPC framework."
title: Interoperability with gRPC
type: docs
-weight: 100
+weight: 2
---
-
diff --git a/content/en/overview/mannual/golang-sdk/tutorial/interop-grpc/call_grpc.md b/content/en/overview/mannual/golang-sdk/tutorial/interoperability/grpc/call_grpc.md
similarity index 98%
rename from content/en/overview/mannual/golang-sdk/tutorial/interop-grpc/call_grpc.md
rename to content/en/overview/mannual/golang-sdk/tutorial/interoperability/grpc/call_grpc.md
index 3c7a2aa9858..9f3afed7b71 100644
--- a/content/en/overview/mannual/golang-sdk/tutorial/interop-grpc/call_grpc.md
+++ b/content/en/overview/mannual/golang-sdk/tutorial/interoperability/grpc/call_grpc.md
@@ -2,6 +2,7 @@
aliases:
- /en/docs3-v2/golang-sdk/tutorial/develop/interflow/call_grpc/
- /en/docs3-v2/golang-sdk/tutorial/develop/interflow/call_grpc/
+ - /en/overview/mannual/golang-sdk/tutorial/interop-grpc/call_grpc/
description: Intercommunication with gRPC applications
title: Intercommunication with gRPC applications
type: docs
diff --git a/content/en/overview/mannual/golang-sdk/tutorial/observability/probe.md b/content/en/overview/mannual/golang-sdk/tutorial/observability/probe.md
index 70372319fea..41872077bba 100644
--- a/content/en/overview/mannual/golang-sdk/tutorial/observability/probe.md
+++ b/content/en/overview/mannual/golang-sdk/tutorial/observability/probe.md
@@ -24,7 +24,7 @@ The probe service runs on an independent HTTP port and supports:
For a complete runnable example, see:
-> [https://github.com/apache/dubbo-go-samples/tree/main/metrics](https://github.com/apache/dubbo-go-samples/tree/main/metrics)
+> [https://github.com/apache/dubbo-go-samples/tree/main/metrics/probe](https://github.com/apache/dubbo-go-samples/tree/main/metrics/probe)
---
diff --git a/content/en/overview/mannual/golang-sdk/tutorial/observability/tracing.md b/content/en/overview/mannual/golang-sdk/tutorial/observability/tracing.md
index d33a532cd88..f5ae6a6ee0c 100644
--- a/content/en/overview/mannual/golang-sdk/tutorial/observability/tracing.md
+++ b/content/en/overview/mannual/golang-sdk/tutorial/observability/tracing.md
@@ -19,7 +19,7 @@ Dubbo-go supports end-to-end tracing based on the [OpenTelemetry](https://opente
Please note that tracing functionality is only enabled when creating the Dubbo application via `dubbo.NewInstance`, which is the `microservice application mode` mentioned in our quick start. The `lightweight RPC API` does not currently support enabling tracing.
## Example Explanation
-You can view the full example source code [here](https://github.com/apache/dubbo-go-samples/tree/main/otel).
+You can view the full example source code [here](https://github.com/apache/dubbo-go-samples/tree/main/otel/tracing).
Enable tracing using `dubbo.WithTracing()`, and you can control tracing behavior with multiple parameters:
@@ -81,4 +81,3 @@ sample-ratio: 0.5
- `trace.WithRatioMode()`
- sample-ratio: sample ratio, only used when sample-mode is ratio, range between 0 and 1
- `trace.WithRatio(float64)`
-
diff --git a/content/en/overview/mannual/golang-sdk/tutorial/rpc/attachments.md b/content/en/overview/mannual/golang-sdk/tutorial/rpc/attachments.md
index a1992fe588b..a597df6b2ce 100644
--- a/content/en/overview/mannual/golang-sdk/tutorial/rpc/attachments.md
+++ b/content/en/overview/mannual/golang-sdk/tutorial/rpc/attachments.md
@@ -5,41 +5,111 @@ type: docs
weight: 4
---
-**The most straightforward way to understand implicit parameter passing is through the HTTP header, which works exactly like an HTTP header, allowing any number of header parameters to be passed outside of the GET or POST request body.** For RPC calls, the context provides the ability to pass additional parameters outside of the method signature's parameters. The implementation varies slightly between different protocols:
-* For the triple protocol, the attachment is converted into standard HTTP headers for transmission.
-* For the Dubbo protocol, the attachment is encoded in a fixed location within the protocol body; please refer to the Dubbo protocol specification.
-
-
+Dubbo-go provides two related ways to pass metadata outside the RPC request and response body:
+
+* **Attachments** are Dubbo RPC implicit parameters. They are stored in `context` under `constant.AttachmentKey` and are commonly used by filters, routing, tracing, or business code that needs request-scoped key-value data. For Triple calls, request attachments are carried as HTTP metadata headers. For Dubbo protocol calls, attachments are encoded in a fixed location in the protocol body.
+* **Triple metadata headers and trailers** are Triple protocol metadata APIs exposed as `http.Header`. They are useful when application code needs direct access to request metadata or response header/trailer data.
+
+Sample source code:
+
+* Attachment sample: <a href="https://github.com/apache/dubbo-go-samples/tree/main/context" target="_blank">dubbo-go-samples/context</a>
+* Triple header/trailer sample: <a href="https://github.com/apache/dubbo-go-samples/tree/main/triple_header_trailer" target="_blank">dubbo-go-samples/triple_header_trailer</a>
+
+Attachment flow:
+
+```text
+┌───── Consumer side ──────────┐
+│ │
+│ ┌──────────────────────┐ │
+│ │ context.Context │ │
+│ │ AttachmentKey │ │
+│ │ map[string]any │ │
+│ └──────────┬───────────┘ │
+│ │ │
+│ ▼ │
+│ ┌──────────────────────┐ │
+│ │ RPCInvocation │ │
+│ │ Attachments() │ │
+│ └──────────┬───────────┘ │
+│ │ │
+└─────────────┼────────────────┘
+ │
+ ▼
+ ┌────────────────┐
+ │ Protocol │
+ │ metadata │
+ │ │
+ │ Triple: header │
+ │ Dubbo : body │
+ └───────┬────────┘
+ │
+ │ network
+ ▼
+┌──────────────┼─── Provider side ────┐
+│ ▼ │
+│ ┌────────────────┐ │
+│ │ Protocol │ │
+│ │ metadata │ │
+│ └───────┬────────┘ │
+│ │ │
+│ ▼ │
+│ ┌──────────────────────┐ │
+│ │ RPCInvocation │ │
+│ │ Attachments() │ │
+│ └──────────┬───────────┘ │
+│ │ │
+│ ▼ │
+│ ┌──────────────────────┐ │
+│ │ context.Context │ │
+│ │ AttachmentKey │ │
+│ │ map[string]any │ │
+│ └──────────┬───────────┘ │
+│ │ │
+│ ▼ │
+│ ┌──────────────────────┐ │
+│ │ Filter / Service │ │
+│ │ implementation │ │
+│ └──────────────────────┘ │
+│ │
+└─────────────────────────────────────┘
+```
{{% alert title="Note" color="primary" %}}
-* When using the triple protocol, only lowercase ASCII characters are supported due to the limitations of HTTP headers.
-* Keys such as path, group, version, dubbo, token, timeout, etc., are reserved fields and should be avoided when passing attachments. It is advisable to ensure key uniqueness through business prefixes.
+* For Triple calls, attachment keys are normalized to lowercase HTTP metadata keys. Use lowercase ASCII business keys when passing attachments.
+* Attachment values should be `string` or `[]string` for Triple calls.
+* Triple metadata keys are case-insensitive. Use standard `http.Header` accessors such as `Get` and `Values` when reading headers or trailers.
+* Keys such as path, group, version, dubbo, token, timeout, etc., are reserved fields. Use a business prefix to keep custom keys unique.
{{% /alert %}}
## 1. Introduction
-This document demonstrates how to use the context in the Dubbo-go framework to pass and read additional parameters, enabling context information transmission. You can view the <a href="https://github.com/apache/dubbo-go-samples/tree/main/context" target="_blank">complete sample source code here</a>.
+This document first shows how to pass request attachments through `context`, and then shows how to use Triple request metadata, response headers, and response trailers.
-## 2. Usage Instructions
+## 2. Attachment Usage Instructions
### 2.1 Client Usage Instructions
-In the client, fields can be passed using the following method, where the key is `constant.AttachmentKey`, i.e., "attachment":
+In the client, fields can be passed through `constant.AttachmentKey`, i.e. `"attachment"`:
```go
- ctx := context.Background()
- ctx = context.WithValue(ctx, constant.AttachmentKey, map[string]interface{}{
- "key1": "user defined value 1",
- "key2": "user defined value 2"
- })
+ctx := context.Background()
+ctx = context.WithValue(ctx, constant.AttachmentKey, map[string]interface{}{
+ "key1": "user defined value 1",
+ "key2": "user defined value 2",
+})
```
### 2.2 Server Usage Instructions
-In the server, fields can be retrieved using the following method, where the value type is map[string]interface{}:
+In the server, fields can be retrieved from `constant.AttachmentKey`. For Triple requests, header values are stored as `[]string`:
+
```go
- attachments := ctx.Value(constant.AttachmentKey).(map[string]interface{})
+attachments := ctx.Value(constant.AttachmentKey).(map[string]interface{})
+if value1, ok := attachments["key1"]; ok {
logger.Infof("Dubbo attachment key1 = %s", value1.([]string)[0])
+}
+if value2, ok := attachments["key2"]; ok {
logger.Infof("Dubbo attachment key2 = %s", value2.([]string)[0])
+}
```
## 3. Example Analysis
@@ -179,3 +249,117 @@ Start the server first, then start the client, and you can observe that the serv
2024-02-26 11:13:14 INFO logger/logging.go:42 Dubbo attachment key1 = [user defined value 1]
2024-02-26 11:13:14 INFO logger/logging.go:42 Dubbo attachment key2 = [user defined value 2]
```
+
+## 4. Triple Header and Trailer
+
+For Triple calls, Dubbo-go also exposes request and response metadata through `http.Header`. Metadata keys are case-insensitive, so application code can use the standard `http.Header` accessors such as `Get` and `Values`.
+
+### 4.1 Request Metadata
+
+The client can attach request metadata before initiating a call:
+
+```go
+import (
+ "context"
+ "net/http"
+
+ triple "dubbo.apache.org/dubbo-go/v3/protocol/triple/triple_protocol"
+)
+
+ctx := triple.NewOutgoingContext(context.Background(), http.Header{
+ "X-Sample-Token": []string{"token"},
+})
+ctx = triple.AppendToOutgoingContext(ctx, "X-Sample-Mode", "metadata")
+
+resp, err := svc.Greet(ctx, &greet.GreetRequest{Name: "hello"})
+```
+
+The server can read the incoming metadata from the request context:
+
+```go
+headers, ok := triple.FromIncomingContext(ctx)
+if ok {
+ token := headers.Get("X-Sample-Token")
+ mode := headers.Get("X-Sample-Mode")
+ _ = token
+ _ = mode
+}
+```
+
+Generated streaming handlers can also read request metadata from the generated stream object:
+
+```go
+token := stream.RequestHeader().Get("X-Sample-Token")
+```
+
+### 4.2 Unary Response Header and Trailer
+
+For generated unary calls, the server can write response metadata with `triple.SetHeader` and `triple.SetTrailer`:
+
+```go
+func (srv *GreetTripleServer) Greet(ctx context.Context, req *greet.GreetRequest) (*greet.GreetResponse, error) {
+ if err := triple.SetHeader(ctx, http.Header{
+ "X-Response-Token": []string{"value"},
+ }); err != nil {
+ return nil, err
+ }
+ if err := triple.SetTrailer(ctx, http.Header{
+ "X-Response-Trailer": []string{"done"},
+ }); err != nil {
+ return nil, err
+ }
+ return &greet.GreetResponse{Greeting: req.Name}, nil
+}
+```
+
+The client can capture the response header and trailer for this call with call options:
+
+```go
+var responseHeader http.Header
+var responseTrailer http.Header
+
+resp, err := svc.Greet(
+ ctx,
+ &greet.GreetRequest{Name: "hello"},
+ client.WithResponseHeader(&responseHeader),
+ client.WithResponseTrailer(&responseTrailer),
+)
+if err != nil {
+ return err
+}
+
+headerValue := responseHeader.Get("X-Response-Token")
+trailerValue := responseTrailer.Get("X-Response-Trailer")
+_ = resp
+_ = headerValue
+_ = trailerValue
+```
+
+### 4.3 Streaming Response Header and Trailer
+
+For generated streaming handlers, response metadata is available on the stream object. The server writes response header and trailer through `ResponseHeader` and `ResponseTrailer`:
+
+```go
+func (srv *GreetTripleServer) GreetStream(stream greet.GreetService_GreetStreamServer) error {
+ stream.ResponseHeader().Set("X-Stream-Response", "value")
+ stream.ResponseTrailer().Set("X-Stream-Trailer", "done")
+ // handle stream messages
+ return nil
+}
+```
+
+The client reads the response metadata from the generated stream object:
+
+```go
+stream, err := svc.GreetStream(ctx)
+if err != nil {
+ return err
+}
+
+headerValue := stream.ResponseHeader().Get("X-Stream-Response")
+trailerValue := stream.ResponseTrailer().Get("X-Stream-Trailer")
+_ = headerValue
+_ = trailerValue
+```
+
+A complete runnable example is available in <a href="https://github.com/apache/dubbo-go-samples/tree/main/triple_header_trailer" target="_blank">dubbo-go-samples/triple_header_trailer</a>.
diff --git a/content/en/overview/mannual/golang-sdk/tutorial/rpc/filter.md b/content/en/overview/mannual/golang-sdk/tutorial/rpc/filter.md
index d63458653a9..616f5e2333b 100644
--- a/content/en/overview/mannual/golang-sdk/tutorial/rpc/filter.md
+++ b/content/en/overview/mannual/golang-sdk/tutorial/rpc/filter.md
@@ -7,7 +7,11 @@ type: docs
weight: 7
---
-Filters dynamically intercept requests or responses to transform or utilize the information contained in the requests or responses. Filters do not typically create responses themselves but provide generic functions that can be "attached" to any RPC request. Dubbo Filters are pluggable, allowing us to insert any type and number of filters into a single RPC request.
+Sample source: <a href="https://github.com/apache/dubbo-go-samples/tree/main/filter" target="_blank">dubbo-go-samples/filter</a>.
+
+Filters dynamically intercept requests or responses to transform or utilize the information contained in them. A filter
+does not usually create a response by itself. Instead, it provides reusable logic that can be attached to RPC calls.
+Dubbo filters are pluggable, so you can compose multiple filters into one consumer or provider invocation chain.
The working principle of filters is illustrated in the diagram below:
@@ -29,44 +33,95 @@ type Filter interface {
}
```
-Filters can be loaded on either the Consumer or Provider side. When loaded on the Consumer side, the downstream of its Invoke function call is the network layer, and OnResponse is called after getting the return result from the network layer when the request ends. When loaded on the Provider side, the downstream of its Invoke function call is user code, and OnResponse is called before passing down to the network layer after user code execution ends.
+Filters can be loaded on either the Consumer or Provider side. On the Consumer side, `Invoke` forwards the call to the
+network layer, and `OnResponse` runs after the response comes back. On the Provider side, `Invoke` forwards the call to
+user code, and `OnResponse` runs after user code finishes and before the response is written back to the network.
+
+This aspect-oriented design makes filters a natural place to implement logging, metrics, tracing, authentication,
+traffic protection, graceful shutdown, generic invocation adaptation, and other cross-cutting capabilities.
+
+### 2. Loading Filters
+
+For new projects, prefer importing only the filters you actually use:
+
+```go
+import _ "dubbo.apache.org/dubbo-go/v3/filter/echo"
+import _ "dubbo.apache.org/dubbo-go/v3/filter/generic"
+```
+
+If you want a one-stop import of most built-in Dubbo Go SDK capabilities, you can also import:
+
+```go
+import _ "dubbo.apache.org/dubbo-go/v3/imports"
+```
+
+There is also a legacy bulk import:
-Filters adopt an aspect-oriented design approach, allowing for reasonable extensions to record logs, set data points, record service performance corresponding to the invoker, limit traffic, and more.
+```go
+import _ "dubbo.apache.org/dubbo-go/v3/filter/filter_impl"
+```
-### 2. Predefined Filters by the Framework
+### 3. Built-in Filters
-A series of predefined filters are available in the framework for direct use in the configuration, with their code implementation located at [filter](https://github.com/apache/dubbo-go/tree/main/filter).
+The framework provides a set of predefined filters that can be enabled directly in configuration. Their code lives in
+the [filter](https://github.com/apache/dubbo-go/tree/main/filter) directory.
- accesslog
- active
-- sign: AuthConsumerFilter
-- auth: AuthProviderFilter
+- padasvc: Adaptive Service Provider Filter
+- sign: Auth Consumer Filter
+- auth: Auth Provider Filter
- echo
-- execute: ExecuteLimitFilter
-- generic: GenericFilter
-- generic_service: GenericServiceFilter
-- pshutdown: GracefulShutdownProviderFilter
-- cshutdown: GracefulShutdownConsumerFilter
-- hystrix_consumer: HystrixConsumerFilter
-- hystrix_provider: HystrixProviderFilter
+- execute: Execute Limit Filter
+- generic: Generic Consumer Filter
+- generic_service: Generic Provider Filter
+- pshutdown: Graceful Shutdown Provider Filter
+- cshutdown: Graceful Shutdown Consumer Filter
- metrics
+- otelServerTrace / otelClientTrace: OpenTelemetry trace filters
+- polaris-limit: Polaris rate limit filter
- seata
- sentinel-provider
- sentinel-consumer
- token
- tps
-- tracing
+- tracing: tracing filter
+
+`hystrix_consumer` and `hystrix_provider` were available in earlier releases. In current 3.3.x documentation, focus on
+the built-in filters that still exist in the main repository and `imports` package.
-### 3. Default Loaded Filters
+### 4. Default Filter Chains
-When users configure custom filter loading strategies in their configuration files, the framework will load both the user-configured filters and default filters together; otherwise, it will only load the default filters. The list of currently activated default filters is as follows:
+If you do not override filter configuration, Dubbo Go SDK applies the following default filter chains:
- Consumer: cshutdown
-- Provider: echo, metrics, token, accesslog, tps, generic_service, executivete, pshutdown
+- Provider: echo, token, accesslog, tps, generic_service, execute, pshutdown
+
+Additional filters may be appended automatically by configuration. For example:
+
+- `metrics` can be appended when metrics are enabled
+- `otelServerTrace` or `otelClientTrace` can be appended when OpenTelemetry tracing is enabled
+- `padasvc` can be appended on the provider side when adaptive service is enabled
+
+When users configure custom filter loading strategies, the framework merges user-configured filters with these default
+chains instead of replacing all runtime behavior blindly.
-### 4. Custom Filters
+A minimal configuration example looks like this:
-Users can create custom filters in their code, register them with the framework, and select them for use in the configuration.
+```yaml
+dubbo:
+ consumer:
+ filter: "metrics,tracing"
+ provider:
+ filter: "accesslog,tps"
+```
+
+Use `consumer.filter` / `reference.filter` for client-side behavior and `provider.filter` / `service.filter` for
+provider-side behavior, depending on whether you are configuring at the root level or per-service level.
+
+### 5. Custom Filters
+
+Users can create custom filters in their code, register them with the framework, and select them in configuration.
```go
func init() {
@@ -89,7 +144,3 @@ func (f *MyClientFilter) OnResponse(ctx context.Context, result protocol.Result,
return result
}
```
-
-## Complete Example
-You can learn how to use the API to configure and enable filters through the following link: <a href="https://github.com/apache/dubbo-go-samples/tree/main/filter" target="_blank">Complete example source code address</a>
-
diff --git a/content/en/overview/mannual/golang-sdk/tutorial/rpc/openapi.md b/content/en/overview/mannual/golang-sdk/tutorial/rpc/openapi.md
index 42dce471e6d..e9bea196a4d 100644
--- a/content/en/overview/mannual/golang-sdk/tutorial/rpc/openapi.md
+++ b/content/en/overview/mannual/golang-sdk/tutorial/rpc/openapi.md
@@ -8,6 +8,8 @@ weight: 5
Dubbo-go provides built-in OpenAPI support that automatically generates OpenAPI 3.0-compliant API documentation for Triple protocol services, with Swagger UI and ReDoc for visual API browsing and debugging.
+Sample source: <a href="https://github.com/apache/dubbo-go-samples/tree/main/rpc/triple/openapi" target="_blank">dubbo-go-samples/rpc/triple/openapi</a>.
+
## Feature Overview
- **Automatic Documentation Generation**: Automatically generates OpenAPI 3.0.1 API documentation based on service interface definitions (protobuf IDL or non-IDL mode)
@@ -329,7 +331,6 @@ func main() {
After starting, visit `http://localhost:20000/dubbo/openapi/swagger-ui/` to view the Swagger UI documentation.
-For the complete example source code, see [dubbo-go-samples OpenAPI example](https://github.com/apache/dubbo-go-samples/tree/main/rpc/triple/openapi).
## Architecture
diff --git a/content/en/overview/mannual/golang-sdk/tutorial/rpc/protocol.md b/content/en/overview/mannual/golang-sdk/tutorial/rpc/protocol.md
index f9887acd66d..0085e000b95 100644
--- a/content/en/overview/mannual/golang-sdk/tutorial/rpc/protocol.md
+++ b/content/en/overview/mannual/golang-sdk/tutorial/rpc/protocol.md
@@ -11,6 +11,11 @@ The Dubbo-go framework provides two built-in protocols: triple and dubbo. In add
* dubbo, a high-performance private communication protocol based on TCP, with the disadvantage of poor universality, more suitable for use between Dubbo SDKs;
* Any protocol extension, by extending the protocol, it can support any RPC protocol. The official ecosystem provides support for JsonRPC, thrift, etc.
+Related samples:
+
+* Triple protocol: <a href="https://github.com/apache/dubbo-go-samples/tree/main/rpc/triple" target="_blank">dubbo-go-samples/rpc/triple</a>
+* Multi-protocol publishing: <a href="https://github.com/apache/dubbo-go-samples/tree/main/rpc/multi-protocols" target="_blank">dubbo-go-samples/rpc/multi-protocols</a>
+
In this document, we will introduce the usage of the triple protocol, how to achieve mutual calls with existing dubbo2 systems, and extend support for more protocols. For more principled introductions, please refer to [Protocol Specification](/en/overview/reference/protocols/triple-spec/) or [related documents in dubbo java](/en/overview/mannual/java-sdk/tasks/protocols/protocol/) .
## triple Protocol
@@ -138,4 +143,3 @@ The Dubbo framework supports protocol extensions. Currently, the officially supp
* jsonrpc
In some scenarios, you can publish services of multiple protocols simultaneously within one application or call services with different protocols simultaneously. Here is a [usage example for multi-protocol publishing](https://github.com/apache/dubbo-go-samples/tree/main/rpc/multi-protocols) for reference.
-
diff --git a/content/en/overview/mannual/golang-sdk/tutorial/rpc/streaming.md b/content/en/overview/mannual/golang-sdk/tutorial/rpc/streaming.md
index 809ac4f3d72..49a71f602df 100644
--- a/content/en/overview/mannual/golang-sdk/tutorial/rpc/streaming.md
+++ b/content/en/overview/mannual/golang-sdk/tutorial/rpc/streaming.md
@@ -4,6 +4,9 @@ title: Streaming Communication
type: docs
weight: 1
---
+
+Sample source: <a href="https://github.com/apache/dubbo-go-samples/tree/main/streaming" target="_blank">dubbo-go-samples/streaming</a>.
+
Streaming communication is a new RPC data transfer mode offered by Dubbo3, suitable for the following scenarios:
- Interfaces that need to send large amounts of data that cannot be placed in a single RPC request or response, requiring batch sending. However, traditional multiple RPC calls cannot resolve issues of order and performance, and if order is to be guaranteed, they must be sent serially.
@@ -17,11 +20,12 @@ There are three types of Streaming communication:
## 1. Introduction
-This document demonstrates how to use streaming communication in Dubbo-go. You can view the <a href="https://github.com/apache/dubbo-go-samples/tree/main/streaming" target="_blank">complete example source code here</a>.
+This document demonstrates how to use streaming communication in Dubbo-go.
## 2. How to use Dubbo-go streaming communication
-In the proto file, add `stream` before the parameters of the methods that require streaming communication and generate the corresponding files using `proto-gen-triple`.
+In the proto file, add `stream` before the request or response type of the methods that require streaming communication,
+and generate the corresponding files using `protoc-gen-go-triple`.
```protobuf
service GreetService {
@@ -195,6 +199,42 @@ func testServerStream(cli greet.GreetService) error {
}
```
+Streaming calls also expose Triple metadata through the generated stream APIs:
+
+| Side | API | Purpose |
+| ---- | --- | ------- |
+| Client stream and bidirectional client | `RequestHeader()` | Add request metadata before the first message is sent |
+| Server stream and bidirectional client | `ResponseHeader()` | Read response headers returned by the server |
+| Server stream and bidirectional client | `ResponseTrailer()` | Read response trailers after the response is completed |
+| Provider stream handlers | `RequestHeader()` | Read request metadata sent by the client |
+| Provider stream handlers | `ResponseHeader()` / `ResponseTrailer()` | Set response headers and trailers |
+
+Use standard `http.Header` methods such as `Set`, `Add`, `Get`, and `Values` when working with these metadata values.
+
+For example, on the client side you can write request metadata before sending the first message:
+
+```go
+stream, err := cli.GreetStream(context.Background())
+if err != nil {
+ return err
+}
+stream.RequestHeader().Set("x-sample-token", "demo-token")
+```
+
+And on the server side you can return response metadata from a stream handler:
+
+```go
+func (srv *GreetTripleServer) GreetServerStream(
+ ctx context.Context,
+ req *greet.GreetServerStreamRequest,
+ stream greet.GreetService_GreetServerStreamServer,
+) error {
+ stream.ResponseHeader().Set("x-stream-header", "ready")
+ stream.ResponseTrailer().Set("x-stream-trailer", "done")
+ return nil
+}
+```
+
## 3. Running Effect
Run the server and client, and you will see the requests return normally.
@@ -213,4 +253,3 @@ TRIPLE server stream resp: [triple]
TRIPLE server stream resp: [triple]
TRIPLE server stream resp: [triple]
```
-
diff --git a/content/en/overview/mannual/golang-sdk/tutorial/service-discovery/application-level-service-discovery.md b/content/en/overview/mannual/golang-sdk/tutorial/service-discovery/application-level-service-discovery.md
new file mode 100644
index 00000000000..c7eef7c5e7a
--- /dev/null
+++ b/content/en/overview/mannual/golang-sdk/tutorial/service-discovery/application-level-service-discovery.md
@@ -0,0 +1,150 @@
+---
+description: "Explains application-level service discovery in dubbo-go, including registry data, metadata modes, and default metadata service settings."
+title: Application-level Service Discovery
+type: docs
+weight: 12
+---
+
+Dubbo-go supports both interface-level registration and application-level service discovery. Interface-level registration stores callable provider URLs directly in the registry. Application-level service discovery stores application instances in the registry, and uses service mapping plus metadata to recover the provider URLs required by consumers.
+
+Application-level service discovery is the current default model. Interface-level registration and application-level service discovery use different registration and subscription paths, and they are not automatically interoperable. A consumer using interface-level discovery cannot discover providers that only register application-level instances; a consumer using application-level discovery cannot discover providers that only register interface-level URLs. Use `all` during migration if b [...]
+
+## Registration Modes
+
+Use the registry type to choose how a provider registers itself:
+
+| Registry type | API option | What is registered |
+| --- | --- | --- |
+| `interface` | `registry.WithRegisterInterface()` | Provider URLs such as `tri://host:port/interface` or `rest://host:port/interface`. |
+| `service` | `registry.WithRegisterService()` | Application instances and instance metadata. Consumers discover instances first, then resolve provider URLs from metadata. |
+| `all` | `registry.WithRegisterServiceAndInterface()` | Both application-level instances and interface-level provider URLs. This is useful during migration. |
+
+Example:
+
+```go
+ins, _ := dubbo.NewInstance(
+ dubbo.WithName("demo-provider"),
+ dubbo.WithRegistry(
+ registry.WithNacos(),
+ registry.WithAddress("127.0.0.1:8848"),
+ registry.WithRegisterService(),
+ ),
+)
+```
+
+When using configuration files, set `registry-type` to `service`, `interface`, or `all`. Use an explicit value if you need deterministic registration behavior.
+
+## What the Registry Stores
+
+In application-level service discovery, the registry does not store the complete callable provider URL as the primary registration data. It stores application-level data, including:
+
+- application name;
+- instance host and port;
+- instance metadata;
+- exported services revision;
+- metadata storage type;
+- metadata service URL parameters;
+- service-to-application mapping.
+
+The consumer first finds which applications provide a service, then subscribes to those application instances. After that, it uses metadata to recover service-level provider URLs.
+
+## Metadata Modes
+
+Application-level discovery needs provider metadata. Dubbo-go supports two metadata storage modes.
+
+### Local Metadata
+
+`local` is the default metadata mode.
+
+In local metadata mode, the provider keeps `MetadataInfo` locally and exposes a metadata service. The provider registers the instance revision and metadata service URL parameters into the registry. The consumer reads these parameters from the provider instance and calls the provider metadata service to fetch `MetadataInfo`.
+
+Flow:
+
+```text
+provider -> registry: application instance + revision + metadata service URL params
+consumer -> registry: discover provider instance
+consumer -> provider metadata service: get MetadataInfo by revision
+```
+
+The metadata service RPC protocol is controlled by `metadata-service-protocol`. The current default is `dubbo`, and it can be configured explicitly:
+
+```go
+ins, _ := dubbo.NewInstance(
+ dubbo.WithName("demo-provider"),
+ dubbo.WithMetadataServiceProtocol("tri"),
+)
+```
+
+The provider and consumer do not need to configure the same `metadata-service-protocol` value. The provider records the metadata service protocol in instance metadata, and the consumer uses that advertised protocol to call the provider metadata service. The consumer runtime must support the protocol advertised by the provider.
+
+### Remote Metadata
+
+In remote metadata mode, the provider reports `MetadataInfo` to a metadata center through metadata report. The consumer reads metadata from the metadata center instead of calling the provider metadata service.
+
+Flow:
+
+```text
+provider -> metadata center: report MetadataInfo
+provider -> registry: application instance + revision
+consumer -> registry: discover provider instance
+consumer -> metadata center: read MetadataInfo by revision
+```
+
+Enable remote metadata with `dubbo.WithRemoteMetadata()` and configure a metadata report:
+
+```go
+ins, _ := dubbo.NewInstance(
+ dubbo.WithName("demo-provider"),
+ dubbo.WithRemoteMetadata(),
+ dubbo.WithMetadataReport(
+ metadata.WithProtocol("nacos"),
+ metadata.WithAddress("127.0.0.1:8848"),
+ ),
+)
+```
+
+The registry can also be reused as the metadata report center. Registry configuration uses `use-as-meta-report=true` by default, unless `registry.WithoutUseAsMetaReport()` is set.
+
+```go
+ins, _ := dubbo.NewInstance(
+ dubbo.WithName("demo-provider"),
+ dubbo.WithRemoteMetadata(),
+ dubbo.WithRegistry(
+ registry.WithNacos(),
+ registry.WithAddress("127.0.0.1:8848"),
+ registry.WithRegisterService(),
+ ),
+)
+```
+
+In remote metadata mode, both providers and consumers must be able to access the same metadata center. `metadata-service-protocol` does not affect remote metadata because the consumer does not call the provider metadata service.
+
+## Current Defaults
+
+| Item | Current default |
+| --- | --- |
+| `metadata-type` | `local` |
+| `metadata-service-protocol` | `dubbo` |
+| registry `use-as-meta-report` | `true` |
+| registry `use-as-config-center` | `true` |
+| default registration and discovery model | application-level service discovery, `registry.WithRegisterService()` or `registry-type: service` |
+
+## Implicit Defaults and Behaviors
+
+Several behaviors are easy to miss because they are derived implicitly when a field is left unset:
+
+- If `registry-type` is not configured, dubbo-go falls back to application-level registration and discovery.
+- Application-level consumers subscribe with `tri` by default if the reference does not explicitly set a business protocol.
+- `metadata-type` defaults to `local`, so consumers fetch metadata from the provider metadata service unless remote metadata is explicitly enabled.
+- In local metadata mode, `metadata-service-protocol` defaults to `dubbo`.
+- If `metadata-service-port` is not configured, the metadata service first tries to reuse the default protocol port; if no usable port is available, dubbo-go falls back to a random port.
+- Registries default to `use-as-meta-report=true`, so a registry can be reused as the metadata report center unless `registry.WithoutUseAsMetaReport()` is set.
+- Registries also default to `use-as-config-center=true`, so the same registry may be reused as the config center unless `registry.WithoutUseAsConfigCenter()` is set.
+
+## Recommendations
+
+- Use `service` registration for application-level service discovery.
+- Use `all` during migration if old interface-level consumers still exist.
+- Use local metadata for simple deployments and samples.
+- Use remote metadata when a metadata center is available and consumers should avoid provider metadata RPC.
+- Configure `metadata-service-protocol` explicitly when local metadata is used and the default metadata transport is not desired.
diff --git a/content/en/overview/mannual/golang-sdk/tutorial/service-discovery/nacos.md b/content/en/overview/mannual/golang-sdk/tutorial/service-discovery/nacos.md
index 391580772e7..0540f15580a 100644
--- a/content/en/overview/mannual/golang-sdk/tutorial/service-discovery/nacos.md
+++ b/content/en/overview/mannual/golang-sdk/tutorial/service-discovery/nacos.md
@@ -9,7 +9,9 @@ weight: 10
---
-This example shows dubbo-go's service discovery feature with Nacos as the registry.
+This example shows dubbo-go's service discovery feature with Nacos as the registry. You can view the
+<a href="https://github.com/apache/dubbo-go-samples/tree/main/registry/nacos" target="_blank">complete example source code</a>
+in dubbo-go-samples.
## Usage
diff --git a/content/en/overview/mannual/golang-sdk/tutorial/service-discovery/zookeeper.md b/content/en/overview/mannual/golang-sdk/tutorial/service-discovery/zookeeper.md
index 97b9fddfe64..9aaf9e1365c 100644
--- a/content/en/overview/mannual/golang-sdk/tutorial/service-discovery/zookeeper.md
+++ b/content/en/overview/mannual/golang-sdk/tutorial/service-discovery/zookeeper.md
@@ -9,7 +9,9 @@ weight: 11
---
-This example shows dubbo-go's service discovery feature with Zookeeper as registry.
+This example shows dubbo-go's service discovery feature with Zookeeper as registry. You can view the
+<a href="https://github.com/apache/dubbo-go-samples/tree/main/registry/zookeeper" target="_blank">complete example source code</a>
+in dubbo-go-samples.
## Usage
@@ -65,4 +67,3 @@ $ ./zkCli.sh
$ go run ./go-client/cmd/client.go
hello world
```
-
diff --git a/content/en/overview/mannual/golang-sdk/tutorial/traffic/condition_router.md b/content/en/overview/mannual/golang-sdk/tutorial/traffic/condition_router.md
index e3e1d8f7d68..b5f37a9343e 100644
--- a/content/en/overview/mannual/golang-sdk/tutorial/traffic/condition_router.md
+++ b/content/en/overview/mannual/golang-sdk/tutorial/traffic/condition_router.md
@@ -5,6 +5,11 @@ type: docs
weight: 1
---
+Related samples:
+
+- Dynamic condition router: <a href="https://github.com/apache/dubbo-go-samples/tree/main/router/condition" target="_blank">dubbo-go-samples/router/condition</a>
+- Static 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>
+
## How to use
### Prerequisites
diff --git a/content/en/overview/mannual/golang-sdk/tutorial/traffic/script_router.md b/content/en/overview/mannual/golang-sdk/tutorial/traffic/script_router.md
index a294c5406a8..218a0b626a5 100644
--- a/content/en/overview/mannual/golang-sdk/tutorial/traffic/script_router.md
+++ b/content/en/overview/mannual/golang-sdk/tutorial/traffic/script_router.md
@@ -5,6 +5,8 @@ type: docs
weight: 1
---
+Sample source: <a href="https://github.com/apache/dubbo-go-samples/tree/main/router/script" target="_blank">dubbo-go-samples/router/script</a>.
+
## How to use
### Prerequisites
@@ -42,6 +44,3 @@ script: |
});
})(invokers, invocation, context);
```
-
-For the complete example, please
-see: [Full Example Code](https://github.com/apache/dubbo-go-samples/tree/main/router/script).
\ No newline at end of file
diff --git a/content/en/overview/mannual/golang-sdk/tutorial/traffic/tag_router.md b/content/en/overview/mannual/golang-sdk/tutorial/traffic/tag_router.md
index 8fd169261b8..35cfb0ba2b8 100644
--- a/content/en/overview/mannual/golang-sdk/tutorial/traffic/tag_router.md
+++ b/content/en/overview/mannual/golang-sdk/tutorial/traffic/tag_router.md
@@ -5,6 +5,11 @@ type: docs
weight: 1
---
+Related samples:
+
+- Dynamic tag router: <a href="https://github.com/apache/dubbo-go-samples/tree/main/router/tag" target="_blank">dubbo-go-samples/router/tag</a>
+- 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>
+
## How to use
### Prerequisites
diff --git a/content/en/overview/mannual/golang-sdk/versions.md b/content/en/overview/mannual/golang-sdk/versions.md
index 4dbd53a5825..ca6b1776e43 100644
--- a/content/en/overview/mannual/golang-sdk/versions.md
+++ b/content/en/overview/mannual/golang-sdk/versions.md
@@ -9,37 +9,48 @@ type: docs
weight: 1
---
-## Recommended Version
+## Recommended Versions
-The current website documentation is applicable to the following versions. If you are using a different version of
-dubbo-go, please refer to the corresponding historical version documents.
+The current website documentation targets the actively maintained Dubbo Go SDK 3.3.x line. If you are using a different
+dubbo-go version, please check the corresponding historical documents and release notes.
-| Go | Dubbo-go | protoc-gen-go-triple | Description |
-|:----:|------------------------------------|---------------------------------------------------------------------------------------|----------------------------------------------------|
-| 1.20 | v3.2.0-rc1 (current documentation) | <a href="https://github.com/dubbogo/protoc-gen-go-triple/" target="_blank">v3.0.0</a> | Current latest stable version, recommended for use |
+| Go | Dubbo-go | protoc-gen-go-triple | Description |
+|:----:|------------------|---------------------------------------------------------------------------------------|--------------------------------------------------|
+| 1.25 | v3.3.2-20260419 | <a href="https://github.com/apache/dubbo-go/tree/main/tools/protoc-gen-go-triple" target="_blank">bundled tool</a> | Current 3.3.2 dated tag, matching the main docs |
+| 1.24 | v3.3.1 | <a href="https://github.com/apache/dubbo-go/tree/main/tools/protoc-gen-go-triple" target="_blank">bundled tool</a> | Latest regular 3.3.x release, recommended for new projects |
+
+{{% alert title="Note" color="primary" %}}
+Use the latest patch release in the same 3.3.x line when possible. The generated Triple code should be produced by the
+`protoc-gen-go-triple` tool shipped in the dubbo-go repository under `tools/protoc-gen-go-triple`.
+{{% /alert %}}
+
+{{% alert title="Historical note" color="secondary" %}}
+Older 3.x releases may reference the former standalone `protoc-gen-go-triple` or `dubbogo-cli` repositories. Those
+links are kept below as historical context for those versions. Current tooling lives in the dubbo-go repository under
+`tools/`.
+{{% /alert %}}
## Historical Versions
### 3.x
-View documentation for versions 3.1.x and earlier:
+View documentation for earlier 3.x versions:
| Go | Dubbo-go | protoc-gen-go-triple | Description |
|:----:|--------------|------------------------------------------------------------|------------------------------------------------------------------------------------------------------------|
+| 1.20 | v3.2.0-rc1 | [v3.0.0](https://github.com/dubbogo/protoc-gen-go-triple/) | Older release-candidate documentation; upgrade to the 3.3.x line for current features |
| 1.16 | v3.1.1 | [v3.0.0](https://github.com/dubbogo/protoc-gen-go-triple/) | Please refer to the README for instructions on generating service stub code compatible with older versions |
| 1.16 | v3.1.0 | [v3.0.0](https://github.com/dubbogo/protoc-gen-go-triple/) | Please refer to the README for instructions on generating service stub code compatible with older versions |
| 1.16 | v3.0.4 | [v3.0.0](https://github.com/dubbogo/protoc-gen-go-triple/) | Please refer to the README for instructions on generating service stub code compatible with older versions |
| 1.16 | v3.0.3 | [v3.0.0](https://github.com/dubbogo/protoc-gen-go-triple/) | Please refer to the README for instructions on generating service stub code compatible with older versions |
| 1.16 | v3.0.2 | [v3.0.0](https://github.com/dubbogo/protoc-gen-go-triple/) | Please refer to the README for instructions on generating service stub code compatible with older versions |
| 1.16 | v3.0.1 | [v3.0.0](https://github.com/dubbogo/protoc-gen-go-triple/) | Please refer to the README for instructions on generating service stub code compatible with older versions |
-| 1.16 | v3.0.0 | [v1.0.5](https://github.com/dubbogo/dubbogo-cli) | |
-| 1.16 | v3.0.0-rc4-1 | [v1.0.2](https://github.com/dubbogo/dubbogo-cli) | |
-| 1.16 | v3.0.0-rc3 | [v1.0.0](https://github.com/dubbogo/dubbogo-cli) | |
+| 1.16 | v3.0.0 | [v1.0.5](https://github.com/dubbogo/dubbogo-cli) | Historical CLI packaging before the tool was moved into the dubbo-go repository |
+| 1.16 | v3.0.0-rc4-1 | [v1.0.2](https://github.com/dubbogo/dubbogo-cli) | Historical CLI packaging before the tool was moved into the dubbo-go repository |
+| 1.16 | v3.0.0-rc3 | [v1.0.0](https://github.com/dubbogo/dubbogo-cli) | Historical CLI packaging before the tool was moved into the dubbo-go repository |
### 1.x
| Go | Dubbo-go | Triple | protoc-gen-go-triple | Description |
|:--:|----------|--------|----------------------|----------------------------------------------------------------|
| | v1.5.0 | v1.1.8 | v1.0.8 | No longer maintained, please upgrade to the latest 3.x version |
-
-
diff --git a/content/en/overview/what/core-features/extensibility.md b/content/en/overview/what/core-features/extensibility.md
index 0b221a42950..39f8de37d03 100644
--- a/content/en/overview/what/core-features/extensibility.md
+++ b/content/en/overview/what/core-features/extensibility.md
@@ -120,6 +120,4 @@ The following examples demonstrate how to extend Dubbo to solve practical proble
This document lists some commonly used extension points in Dubbo, but there are many more extension points available for flexible customization. The extension definitions and configuration methods also vary across different language SDKs. Below are the extension point manuals for Dubbo SDKs.
* [Java Extension Point Manual](../../mannual/java-sdk/reference-manual/spi/description/)
-* [Go Extension Point Manual](../../mannual/golang-sdk/refer/sourcecode/aop_and_extension.md)
-
-It seems like you haven't pasted the Markdown content yet. Please provide the content you need translated, and I'll handle the translation while adhering to the specified rules.
+* [Go Extension Point Manual](../../mannual/golang-sdk/sourcecode/aop_and_extension/)
diff --git a/content/en/overview/what/core-features/protocols.md b/content/en/overview/what/core-features/protocols.md
index 7db46afd022..134bb91546f 100644
--- a/content/en/overview/what/core-features/protocols.md
+++ b/content/en/overview/what/core-features/protocols.md
@@ -79,7 +79,7 @@ In addition to the protocols introduced above, you can also run the following pr
For the configuration and usage methods of the above protocols, including how to configure `single-port multi-protocol` support, please refer to the following SDK example documents:
* [Java](../../mannual/java-sdk/reference-manual/protocol/)
-* [Golang](../../mannual/golang-sdk/refer/sourcecode/protocol.md)
+* [Golang](../../mannual/golang-sdk/sourcecode/protocol/)
* [Rust](../../mannual/rust-sdk/)
## Custom Extensions
diff --git a/content/en/overview/what/core-features/service-discovery.md b/content/en/overview/what/core-features/service-discovery.md
index 64bb4bf88df..dd2ad76fe83 100644
--- a/content/en/overview/what/core-features/service-discovery.md
+++ b/content/en/overview/what/core-features/service-discovery.md
@@ -64,7 +64,7 @@ The complete workflow is shown in the figure above. First, the consumer receives
Dubbo service discovery extends support for multiple registry components such as Nacos, Zookeeper, Consul, Redis, Kubernetes, etc. You can switch between different implementations through configuration, and it also supports configurations like authentication and namespace isolation. For specific configuration methods, please refer to the SDK documentation:
* [Java](../../mannual/java-sdk/reference-manual/registry)
-* [Golang](../../mannual/golang-sdk/refer/sourcecode/registry.md)
+* [Golang](../../mannual/golang-sdk/sourcecode/registry/)
* [Rust](../../mannual/rust-sdk/)
Dubbo also supports scenarios where multiple registries are configured within an application, such as dual registration and dual subscription. This is very useful for scenarios like intercommunication of different cluster addresses and cluster migration. We will add examples of `Best Practices` for this part in future documentation.
diff --git a/content/zh-cn/overview/mannual/golang-sdk/introduction.md b/content/zh-cn/overview/mannual/golang-sdk/introduction.md
index c083599cc56..210b992a181 100644
--- a/content/zh-cn/overview/mannual/golang-sdk/introduction.md
+++ b/content/zh-cn/overview/mannual/golang-sdk/introduction.md
@@ -55,9 +55,9 @@ dubbo-go 总体上遵循 `框架内核+插件` 的的设计理念,左侧的 `

请参考以下链接了解更多 dubbo-go 跨语言或跨产品的互通细节:
-* [与 Dubbo 其他多语言体系互通 - 基于 triple+protobuf](../tutorial/interop-dubbo/)
-* [与 Dubbo2 Java互通 - 基于 dubbo2+hessian2](../tutorial/interop-dubbo)
-* [与 gRPC 体系互通](../tutorial/interop-grpc)
+* [与 Dubbo 其他多语言体系互通 - 基于 triple+protobuf](../tutorial/interoperability/dubbo-java/)
+* [与 Dubbo2 Java互通 - 基于 dubbo2+hessian2](../tutorial/interoperability/dubbo-java/)
+* [与 gRPC 体系互通](../tutorial/interoperability/grpc/)
#### 多协议支持
除了 triple 协议之外,dubbo-go 支持更多的 RPC 协议和序列化方式:
@@ -121,4 +121,3 @@ dubbo-go 实现的流量治理规则完全遵循 Dubbo 框架设计的流量治
-
diff --git a/content/zh-cn/overview/mannual/golang-sdk/quickstart/microservices.md b/content/zh-cn/overview/mannual/golang-sdk/quickstart/microservices.md
index f234b563735..92814dbabae 100644
--- a/content/zh-cn/overview/mannual/golang-sdk/quickstart/microservices.md
+++ b/content/zh-cn/overview/mannual/golang-sdk/quickstart/microservices.md
@@ -11,6 +11,8 @@ weight: 2
本示例演示了使用 dubbo-go 开发微服务应用,为应用增加包括服务发现、负载均衡、流量管控等微服务核心能力。
+示例源码:<a href="https://github.com/apache/dubbo-go-samples/tree/main/registry/nacos" target="_blank">dubbo-go-samples/registry/nacos</a>。
+
## 前置条件
本示例我们继续使用 Protobuf 开发微服务应用,请参考 [开发 rpc server 和 rpc client](../rpc) 了解如何安装 protoc、protoc-gen-go-triple 等必须插件。
@@ -190,4 +192,3 @@ ins, err := dubbo.NewInstance(
-
diff --git a/content/zh-cn/overview/mannual/golang-sdk/quickstart/rpc.md b/content/zh-cn/overview/mannual/golang-sdk/quickstart/rpc.md
index af06b78ad9e..4e33d4d857f 100644
--- a/content/zh-cn/overview/mannual/golang-sdk/quickstart/rpc.md
+++ b/content/zh-cn/overview/mannual/golang-sdk/quickstart/rpc.md
@@ -14,6 +14,8 @@ weight: 1
本示例演示了基于 Triple 协议的 RPC 通信模式,示例使用 Protocol Buffer 定义 RPC 服务,并演示了代码生成、服务发布和服务访问等过程。
+示例源码:<a href="https://github.com/apache/dubbo-go-samples/tree/main/helloworld" target="_blank">dubbo-go-samples/helloworld</a>。
+
## 前置条件
因为使用 Protocol Buffer 的原因,我们首先需要安装相关的代码生成工具,这包括 `protoc`、`protoc-gen-go`、`protoc-gen-go-triple`。
@@ -28,7 +30,10 @@ weight: 1
```shell
go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
- go install github.com/dubbogo/protoc-gen-go-triple/v3@v3.0.3
+
+ git clone --depth 1 https://github.com/apache/dubbo-go.git
+ cd dubbo-go/tools/protoc-gen-go-triple
+ go install .
```
确保 `protoc-gen-go`、`protoc-gen-go-triple` 在你的 `PATH` 中。这可以通过 `which protoc-gen-go` 验证,如果该命令不能正常工作的话,请执行以下命令:
@@ -38,11 +43,15 @@ weight: 1
[ -n "$(go env GOPATH)" ] && export PATH="$(go env GOPATH)/bin:${PATH}"
```
+ `protoc-gen-go-triple` 现在维护在 dubbo-go 仓库的
+ <a href="https://github.com/apache/dubbo-go/tree/main/tools/protoc-gen-go-triple" target="_blank">tools/protoc-gen-go-triple</a>
+ 目录下。请从该目录安装;修改 `.proto` 服务定义后,请同步重新生成 `*.triple.go` 文件。
+
## 快速运行示例
### 下载示例源码
我们在 <a href="https://github.com/apache/dubbo-go-samples/" target="_blank">apache/dubbo-go-samples</a> 仓库维护了一系列 dubbo-go 使用示例,用来帮助用户快速学习 dubbo-go 使用方式。
-你可以 <a href="https://github.com/apache/dubbo-go-samples/archive/refs/heads/master.zip" target="_blank">下载示例zip包并解压</a>,或者克隆仓库:
+你可以 <a href="https://github.com/apache/dubbo-go-samples/archive/refs/heads/main.zip" target="_blank">下载示例 zip 包并解压</a>,或者克隆仓库:
```shell
$ git clone --depth 1 https://github.com/apache/dubbo-go-samples
@@ -213,6 +222,10 @@ func main() {
以上即是 dubbo-go rpc 的基本工作原理!
+完成基础 unary 调用后,同一套生成的 Triple client 和 server 还支持服务端流、客户端流、双向流、请求
+metadata、响应 header/trailer、filter、健康检查、超时、重试和 OpenAPI 暴露等能力。可以继续阅读 RPC
+框架部分的专题文档。
+
## 更多内容
{{< blocks/section color="white" height="auto">}}
<div class="td-content list-page">
@@ -242,7 +255,3 @@ func main() {
<hr>
</div>
{{< /blocks/section >}}
-
-
-
-
diff --git a/content/zh-cn/overview/mannual/golang-sdk/refer/_index.md b/content/zh-cn/overview/mannual/golang-sdk/refer/_index.md
index c881a44468f..cf1a15fdd9b 100644
--- a/content/zh-cn/overview/mannual/golang-sdk/refer/_index.md
+++ b/content/zh-cn/overview/mannual/golang-sdk/refer/_index.md
@@ -4,8 +4,16 @@ aliases:
- /zh-cn/docs3-v2/golang-sdk/refer/
- /zh-cn/overview/mannual/golang-sdk/tutorial/develop/config-center/
- /zh-cn/overview/mannual/golang-sdk/tutorial/develop/features/
-description: Dubbo-go 更多参考资料
-title: 参考手册
+description: 当前 Dubbo Go 应用开发中的概念与集成参考资料。
+title: 参考资料
type: docs
-weight: 5
+weight: 6
---
+
+本节收录的是对 quickstart 和 tutorial 的补充参考页。
+
+适合查看的主题包括:
+
+* 泛化调用参考
+* Nacos 等注册中心集成说明
+* Dubbo Go 生态仓库概览
diff --git a/content/zh-cn/overview/mannual/golang-sdk/refer/ecology.md b/content/zh-cn/overview/mannual/golang-sdk/refer/ecology.md
index eeaa2d13b06..a6ae0492453 100644
--- a/content/zh-cn/overview/mannual/golang-sdk/refer/ecology.md
+++ b/content/zh-cn/overview/mannual/golang-sdk/refer/ecology.md
@@ -2,63 +2,80 @@
aliases:
- /zh/docs3-v2/golang-sdk/refer/ecology/
- /zh-cn/docs3-v2/golang-sdk/refer/ecology/
-description: Dubbo-go 生态组件
+description: 当前 Dubbo Go 生态仓库与工具概览
title: 生态组件
type: docs
weight: 1
---
-### Dubbo-go
+相关仓库与示例:
-[github.com/apache/dubbo-go](https://github.com/apache/dubbo-go)
+* 主运行时仓库:[apache/dubbo-go](https://github.com/apache/dubbo-go)
+* 示例仓库:[apache/dubbo-go-samples](https://github.com/apache/dubbo-go-samples)
+* 泛化调用示例:[dubbo-go-samples/generic](https://github.com/apache/dubbo-go-samples/tree/main/generic)
+* Nacos 注册中心示例:[dubbo-go-samples/registry/nacos](https://github.com/apache/dubbo-go-samples/tree/main/registry/nacos)
+* Triple 示例:[dubbo-go-samples/rpc/triple](https://github.com/apache/dubbo-go-samples/tree/main/rpc/triple)
-Apache Dubbo Go 语言实现主仓库
+这个页面用于梳理当前 Dubbo Go 生态里的主要仓库。很多旧文档还会引用 `dubbogo/*` 下的历史仓库或工具位置;如果是今天要开发或排查问题,优先以 Apache 名下的仓库作为入口。
-### Dubbo-go-samples
+## dubbo-go
+
+[github.com/apache/dubbo-go](https://github.com/apache/dubbo-go)
+
+Dubbo Go 主运行时仓库,包含:
+
+* 核心运行时代码
+* 内置 protocol、registry、filter、router、load balance
+* `tools/protoc-gen-go-triple` 等工具
+* `tools/dubbogo-cli` 等工具
+
+## dubbo-go-samples
[github.com/apache/dubbo-go-samples](https://github.com/apache/dubbo-go-samples)
-dubbo-go 的使用示例:
-* config-api: 使用 API 进行配置初始化
-* configcenter: 使用不同的配置中心,目前支持三种:zookeeper、apollo、和 nacos
-* context: 如何使用上下文传递 attachment
-* direct: 直连模式
-* game: 游戏服务例子
-* generic: 泛化调用
-* rpc: RPC 调用例子, 包含 Triple、Dubbo等协议以及跨语言/gRPC互通示例
-* helloworld: RPC调用入门例子
-* logger: 日志例子
-* registry: 展示与不同注册中心的对接,包含了 zk、nacos、etcd
-* metrics: 数据上报
-* filter: 使用提供filter和自定义filter的例子
-* registry/servicediscovery:应用级服务发现例子
-* router: 路由例子
-* tracing: 链路追踪例子
+这是最适合查找可运行示例的仓库。比较常用的目录包括:
-### Dubbo-go-pixiu
+* `helloworld`
+* `config_yaml`
+* `generic`
+* `registry/nacos`、`registry/zookeeper`、`registry/etcd`、`registry/polaris`
+* `rpc/triple`、`rpc/multi-protocols`、`rpc/grpc`
+* `filter/custom`、`filter/token`、`filter/sentinel`
+* `router/condition`、`router/tag`、`router/script`、`router/static_config`
+* `mesh`
+* `java_interop/*`
+* `triple_header_trailer`
-[github.com/apache/dubbo-go-pixiu](https://github.com/apache/dubbo-go-pixiu)
+## protoc-gen-go-triple
-dubbo-go-pixiu 网关支持以 dubbo 协议和 http 协议调用 dubbo/dubbo-go 集群
+[apache/dubbo-go/tools/protoc-gen-go-triple](https://github.com/apache/dubbo-go/tree/main/tools/protoc-gen-go-triple)
-### Dubbo-getty
+Dubbo Go Triple 服务的 protobuf 代码生成插件。新的文档应当指向这里,而不是历史上的独立工具仓库。
-[github.com/apache/dubbo-getty](https://github.com/apache/dubbo-getty)
+## dubbogo-cli
+
+[apache/dubbo-go/tools/dubbogo-cli](https://github.com/apache/dubbo-go/tree/main/tools/dubbogo-cli)
-dubbo-getty 是一个Go语言异步网络 io 库,支持 tcp/udp/websocket 协议。
+用于 Dubbo / Dubbo Go 调试与互通场景的命令行工具。现在它已经位于主仓库 `apache/dubbo-go` 内部。
-### Dubbo-go-hessian2
+## dubbo-go-hessian2
[github.com/apache/dubbo-go-hessian2](https://github.com/apache/dubbo-go-hessian2)
-Dubbo-go-hessian2 是一个Go语言 hessian2 序列化协议库
+Dubbo Go 使用的 Hessian2 序列化库,在 Dubbo 协议和泛化调用互通场景里很常见。
+
+## dubbo-getty
+
+[github.com/apache/dubbo-getty](https://github.com/apache/dubbo-getty)
+
+Dubbo Go 生态中使用的异步网络 IO 库之一。
+
+## 关于旧仓库引用
-### Dubbogo-tools
+一些旧文章里还会提到:
-[github.com/dubbogo/tools](https://github.com/dubbogo/tools)
+* 非 Apache 名下的历史工具仓库
+* 旧的独立 Triple 代码生成工具仓库
+* 旧的 CLI 安装说明
-包括
-- dubbo-cli 工具(废弃)
-- imports-formatter Go语言 imports 块格式化工具
-- protoc-gen-triple PB编译插件
-- protoc-gen-dubbo3grpc PB编译插件
\ No newline at end of file
+如果是当前 Dubbo Go 开发,优先使用 Apache 仓库以及 `apache/dubbo-go` 下的 `tools/` 目录。
diff --git a/content/zh-cn/overview/mannual/golang-sdk/refer/generic.md b/content/zh-cn/overview/mannual/golang-sdk/refer/generic.md
index 82babaf04a6..24b3fb13cf7 100644
--- a/content/zh-cn/overview/mannual/golang-sdk/refer/generic.md
+++ b/content/zh-cn/overview/mannual/golang-sdk/refer/generic.md
@@ -3,108 +3,61 @@ aliases:
- /zh/docs3-v2/golang-sdk/preface/concept/generic/
- /zh-cn/docs3-v2/golang-sdk/preface/concept/generic/
- /zh-cn/overview/mannual/golang-sdk/preface/concept/generic/
-description: 泛化调用
+description: 泛化调用参考
keywords: 泛化调用
title: 泛化调用
type: docs
weight: 2
---
-泛化调用是一种 Dubbo-Go 的特殊调用方式,它允许中间节点在没有接口信息的情况下传递调用信息,常被用于测试、网关的场景下。泛化调用支持 Dubbo 和 Triple 协议。通过 `client.NewGenericService` 创建泛化服务时,默认使用 Hessian2 作为传输序列化方案。
+相关示例:
-## 背景
+* 泛化调用示例:<a href="https://github.com/apache/dubbo-go-samples/tree/main/generic" target="_blank">dubbo-go-samples/generic</a>
+* Triple 示例:<a href="https://github.com/apache/dubbo-go-samples/tree/main/rpc/triple" target="_blank">dubbo-go-samples/rpc/triple</a>
-为了便于理解,这篇文档中以网关使用场景介绍泛化调用。我们先来考虑普通调用(非泛化调用)。下图包含了 consumer 和 provider 两个关键角色(后文中用 endpoint 代表一个 consumer 或一个 provider),各自都有一份关于 org.apache.dubbo.sample.User 接口的定义。假定在调用行为中需要使用 org.apache.dubbo.sample.User 接口。
+另见:[源码指南:泛化调用](/zh-cn/overview/mannual/golang-sdk/sourcecode/generic/)。
-
+泛化调用允许调用方在没有目标接口生成代码 stub 的情况下发起远程调用。它常见于网关、测试、互通、动态调用等场景。
-RPC 需要借助网络介质传输,因此数据不能以 go struct 形式传输,而必须以二进制形式传输。这就要求 consumer 端在传输前,需要将实现 org.apache.dubbo.sample.User 接口的结构体序列化为二进制格式。同样的,对于 provider 端,需要将二进制数据反序列化为结构体信息。**总之,普通调用要求接口信息在每一个 endpoint 必须有相同的定义,这样才能保证数据序列化和反序列化的结果与预期一致**。
+## 推荐入口
-在网关场景下,网关不可能存储全部接口定义。比如一个网关需要转发 100 个服务调用,每个服务需要的接口数量为 10 个,普通调用要求把 1000 个(100 * 10)接口定义提前全部存储在网关内,这显然是难以做到的。所以有没有一种方式可以既不需要提前存储接口定义,又能正确转发调用呢?答案是肯定的,这就是使用泛化调用的原因。
+对于当前 Dubbo Go,推荐使用的入口是:
-## 原理
+* `client.NewGenericService(...)`
+* `filter/generic.GenericService.Invoke(...)`
+* `filter/generic.GenericService.InvokeWithType(...)`
-泛化调用本质上就是把复杂结构转化为通用结构,这里说的通用结构是指 map、string 等,网关是可以顺利解析并传递这些通用结构的。
+这是现在写新泛化调用代码时的标准运行时路径。早期基于 `config.ReferenceConfig` 的手工示例属于兼容路径,不应再作为新文档的默认方案。
-
+## Triple 场景下的典型用法
-Dubbo-go v3 支持多种泛化方式,包括 Map(默认)、Gson、Protobuf-JSON 和 Bean。其中 Map 泛化方式最为常用,下面以此为例进行说明。以 User 接口为例,其定义如下所示。
+如果是直连调用:
```go
-// definition
-type User struct {
- ID string
- Name string
- Age int32
-}
-
-func (u *User) JavaClassName() string {
- return "org.apache.dubbo.sample.User"
-}
-```
-
-假定调用一个服务需要一个 user 作为入参,其定义如下所示。
-
-```go
-// an instance of the User
-user := &User{
- ID: "1",
- Name: "Zhangsan",
- Age: 20,
+ins, err := dubbo.NewInstance(dubbo.WithName("generic-client"))
+if err != nil {
+ panic(err)
}
-```
-那么在使用 Map 泛化方式下,user 会被自动转换为 Map 格式,如下所示。
-
-```go
-usermap := map[interface{}]interface{} {
- "iD": "1",
- "name": "zhangsan",
- "age": 20,
- "class": "org.apache.dubbo.sample.User",
+cli, err := ins.NewClient()
+if err != nil {
+ panic(err)
}
-```
-
-需要注意的是:
-
-- Map 泛化方式会自动将首字母小写,即 ID 会被转换为 iD,如果需要对齐 Dubbo-Java 请考虑将 ID 改为 Id;
-- 如果需要精确控制 Map 中的 key 名称,可以通过 `m` struct tag 显式指定。例如 `` Name string `m:"userName"` `` 会使 key 变为 `userName` 而非默认的 `name`;
-- 当结构体实现了 `hessian.POJO` 接口时,泛化结果中会自动插入 `class` 字段,用于标识原有接口类。可通过配置 `generic.include.class=false` 关闭此行为,适用于纯 Go 服务间的泛化调用场景。
-
-## 使用
-
-泛化调用对 provider 端是透明的,即 provider 端不需要任何显式配置就可以正确处理泛化请求。
-
-### 基于 Triple 协议泛化调用
-
-Triple 协议(dubbo3)已支持泛化调用。`NewGenericService` 内部走统一的 dial 流程,既支持通过注册中心发现服务,也支持通过 `client.WithURL` 进行直连调用。完整示例请参见 [dubbo-go-samples/generic](https://github.com/apache/dubbo-go-samples/tree/main/generic)。以下以直连调用为例。
-
-首先创建 dubbo 实例和客户端,然后通过 `cli.NewGenericService` 创建泛化服务,如下所示。
-
-```go
-ins, err := dubbo.NewInstance(dubbo.WithName("generic-client"))
-
-cli, err := ins.NewClient(
- client.WithClientProtocolTriple(),
- client.WithClientSerialization(constant.Hessian2Serialization),
-)
genericService, err := cli.NewGenericService(
"org.apache.dubbo.samples.UserProvider",
+ client.WithProtocolTriple(),
+ client.WithSerialization(constant.Hessian2Serialization),
client.WithURL("tri://127.0.0.1:50052"),
client.WithVersion("1.0.0"),
client.WithGroup("triple"),
)
+if err != nil {
+ panic(err)
+}
```
-`NewGenericService` 方法接收的参数分别是:
-
-- 服务接口名;
-- `client.WithURL`: 直连地址,使用 `tri://` 协议前缀;
-- `client.WithVersion`: 服务版本;
-- `client.WithGroup`: 服务分组。
-
-接着可以对服务发起泛化调用:
+然后就可以按方法名动态调用远端方法:
```go
resp, err := genericService.Invoke(
@@ -115,208 +68,50 @@ resp, err := genericService.Invoke(
)
```
-### 基于 Dubbo URL 泛化调用
-
-基于 Filter 泛化调用对 consumer 是透明的,典型应用场景是网关。这种方式需要要求 Dubbo URL 中包含泛化调用标识,如下所示。
-
-```plain
-dubbo://127.0.0.1:20000/org.apache.dubbo.sample.UserProvider?generic=true&...
-```
-
-这个 Dubbo URL 表达的语意是:
-
-- RPC 协议为 dubbo;
-- org.apache.dubbo.sample.UserProvider 接口位于 127.0.0.1:20000;
-- 使用泛化调用(generic=true)。
-
-Consumer 端的 Filter 会自动根据 Dubbo URL 携带的配置将普通调用转化为泛化调用。当 `inv.Reply()` 设置了目标结构体指针时,consumer 侧 Filter 会在 `OnResponse` 阶段自动将 map 结果反序列化为相应的对象;若未设置,则响应结果仍以泛化格式(如 map)返回。
-
-### 手动泛化调用(传统方式)
-
-> 推荐使用上文中 `client.NewGenericService` 的方式进行泛化调用,以下为基于 `config.ReferenceConfig` 的传统方式,仅作参考。
+这是理解泛化调用最直接的方式,也和当前 `dubbo-go-samples/generic` 的示例结构一致。
-手动泛化调用通过 `config.ReferenceConfig` 构建引用并显式发起泛化调用,典型应用场景是测试。
+## 自动结果映射
-泛化调用不需要创建配置文件(dubbogo.yaml),但是需要在代码中手动配置注册中心、reference 等信息,初始化方法被封装到 newRefConf 方法中,如下所示。
+如果你不想手动把返回的 map 再转成 Go struct,可以使用 `InvokeWithType(...)`:
```go
-func newRefConf(appName, iface, protocol string) config.ReferenceConfig {
- registryConfig := &config.RegistryConfig{
- Protocol: "zookeeper",
- Address: "127.0.0.1:2181",
- }
-
- refConf := config.ReferenceConfig{
- InterfaceName: iface,
- Cluster: "failover",
- Registry: []string{"zk"},
- Protocol: protocol,
- Generic: "true",
- }
-
- rootConfig := config.NewRootConfig(config.WithRootRegistryConfig("zk", registryConfig))
- _ = rootConfig.Init()
- _ = refConf.Init(rootConfig)
- refConf.GenericLoad(appName)
-
- return refConf
-}
-```
-
-newRefConf 方法接收三个参数,分别是:
-
-- appName: 应用名;
-- iface: 服务接口名;
-- protocol: RPC 协议,目前只支持 dubbo 和 tri(triple 协议)。
-
-在上述方法中,为了保持函数简单性,把注册中心设置为一个固定值,即使用在 127.0.0.1:2181 的 ZooKeeper 作为注册中心,在实践中可以根据实际情况自由定制。
-
-我们可以很容易的获取一个 ReferenceConfig 实例,暂时命名为 refConf。
-
-```go
-refConf := newRefConf("example.dubbo.io", "org.apache.dubbo.sample.UserProvider", "tri")
-```
-
-接着我们可以对 org.apache.dubbo.sample.UserProvider 服务的 GetUser 方法发起泛化调用。
-
-```go
-resp, err := refConf.
- GetRPCService().(*generic.GenericService).
- Invoke(
- context.TODO(),
- "GetUser",
- []string{"java.lang.String"},
- []hessian.Object{"A003"},
- )
-```
-
-GenericService 的 Invoke 方法接收四个参数,分别是:
-
-- context;
-- 方法名: 在这个例子中表示调用 GetUser 方法;
-- 参数类型: GetUser 方法接收一个 string 类型的参数,如果目标方法接收多个参数,可以写为 `[]string{"type1", "type2", ...}`,如果目前方法是无参的,则需要填入一个空数组 `[]string{}`;
-- 实参: 写法同参数类型,如果是无参函数,依然要填入一个空数组 `[]hessian.Object{}` 占位。
-
-### 泛化调用获取结果自动反序列化
-
-在 `Invoke` 方法中,返回值 `resp` 是一个 `map` 类型(对于 `MapGeneralizer`),用户需要手动进行类型转换。为了简化这一过程,dubbo-go 提供了 `InvokeWithType` 方法,可以将结果自动反序列化为用户指定的结构体。
-
-以下示例基于 `client.NewGenericService` 方式:
-
-```go
-// 定义结果结构体
type User struct {
- ID string
- Name string
- Age int32
+ ID string
+ Name string
+ Age int32
}
var user User
-// 直接将结果反序列化到 user 结构体中
-err := genericService.InvokeWithType(
- context.Background(),
- "GetUser1",
- []string{"java.lang.String"},
- []hessian.Object{"A003"},
- &user,
+err = genericService.InvokeWithType(
+ context.Background(),
+ "GetUser1",
+ []string{"java.lang.String"},
+ []hessian.Object{"A003"},
+ &user,
)
-
-if err != nil {
- // 处理错误
-}
-fmt.Println(user.Name)
-```
-
-如果使用传统的 `config.ReferenceConfig` 方式,调用方式如下:
-
-```go
-var user User
-err := refConf.
- GetRPCService().(*generic.GenericService).
- InvokeWithType(
- context.TODO(),
- "GetUser",
- []string{"java.lang.String"},
- []hessian.Object{"A003"},
- &user,
- )
-
-if err != nil {
- // 处理错误
-}
-fmt.Println(user.Name)
```
-注意:`InvokeWithType` 目前仅支持默认的 Map 泛化方式。
-
-## 泛化方式选择
-
-Dubbo-go 支持以下四种泛化方式,通过 `generic` 参数值区分:
-
-| 泛化方式 | 参数值 | 泛化格式 | 适用场景 |
-|---------|-------|---------|---------|
-| Map(默认) | `true` | `map[string]any` | 通用场景,Go 与 Java 互通 |
-| Gson | `gson` | JSON 字符串 | 需要 JSON 格式交互的场景 |
-| Protobuf-JSON | `protobuf-json` | JSON 字符串 | Protobuf 消息的泛化调用 |
-| Bean | `bean` | `JavaBeanDescriptor` | 与 Java Bean 序列化对齐 |
-
-使用 `client.NewGenericService` 时默认采用 Map 泛化方式。如需使用其他方式,可在 `ReferenceConfig` 中将 `Generic` 字段设置为对应的参数值。
-
-在大多数场景下,推荐使用默认的 Map 泛化方式。
-
-## 跨语言 RPC 接口定义建议
+`InvokeWithType(...)` 适合“传输层使用泛化调用,但调用方仍希望得到强类型 Go 结果”的场景。
-在泛化调用或跨语言调用场景下,Go 的 variadic 方法签名(例如 `args ...string`)容易引入额外的接口定义歧义。
-现有 variadic 服务仍保持兼容,但对于新的跨语言服务或需要面向泛化调用的服务,不建议继续将 `...T` 作为 RPC 接口定义的一部分。
+## 泛化方式
-这是因为 variadic 参数在 Go 中具有特殊语义,而在跨语言调用、动态参数组装、泛化调用和序列化过程中,通常只能被表示为普通数组或列表。
-这会增加调用侧与服务侧对参数形态理解不一致的风险。
+Dubbo Go 通过 `generic` 配置支持多种泛化方式:
-### 推荐模式
-
-对于新的服务接口定义,建议优先采用以下方式:
-
-- 对于“多个同类型参数”的场景,使用 `[]T` 替代 `...T`
-- 对于参数可能继续演进的场景,使用 request/response struct
-- 对于新的跨语言服务,优先使用 Triple + Protobuf IDL,并通过 `repeated` 字段表达重复参数
-
-### 迁移示例
-
-不建议在新的跨语言接口定义中继续使用:
-
-```go
-func MultiArgs(ctx context.Context, args ...string) error
-```
+| 泛化方式 | 参数值 | 返回形态 | 典型用途 |
+| --- | --- | --- | --- |
+| Map | `true` | `map[string]any` 风格数据 | 默认且最常用 |
+| Gson | `gson` | JSON 字符串 | 面向 JSON 的互通 |
+| Protobuf-JSON | `protobuf-json` | JSON 字符串 | protobuf 服务互通 |
+| Bean | `bean` | Java bean descriptor | Java 兼容场景 |
-更推荐使用切片参数:
-
-```go
-func MultiArgs(ctx context.Context, args []string) error
-```
-
-如果接口后续还可能继续扩展,建议使用请求对象:
-
-```go
-type MultiArgsRequest struct {
- Args []string
-}
-
-func MultiArgs(ctx context.Context, req *MultiArgsRequest) error
-```
-
-对于新的 Triple + Protobuf 服务,可以使用 `repeated` 字段表达同类输入:
-
-```proto
-message MultiArgsRequest {
- repeated string args = 1;
-}
-```
+对于大多数 Go 或 Go/Java 互通场景,默认的 Map 泛化方式仍然是最实用的选择。
-### 边界说明
+## 接口定义建议
-现有 variadic 服务仍保持兼容,这里的建议主要面向新的服务接口定义设计。
-如果服务需要面向跨语言消费者、网关转发或泛化调用,建议尽量避免将 variadic 参数作为公开 RPC 接口定义的一部分。
+如果一个服务预期要支持泛化调用或跨语言消费,建议:
-通常情况下,业务输入应尽量显式建模为结构化字段;非业务上下文信息应通过 attachments 或 IDL metadata 传递,而不是依赖 variadic 参数表达。
+* 优先使用显式 request struct,而不是复杂的散装参数列表;
+* 在公开 RPC 接口中优先使用 `[]T`,不要使用 variadic `...T`;
+* 新的跨语言服务优先使用 Triple + Protobuf IDL。
-相关阅读:[【Dubbo-go 服务代理模型】](https://blog.csdn.net/weixin_39860915/article/details/122738548)
+这样接口在动态调用方、网关和泛化序列化场景里会更容易建模。
diff --git a/content/zh-cn/overview/mannual/golang-sdk/refer/nacos.md b/content/zh-cn/overview/mannual/golang-sdk/refer/nacos.md
index c343fb0871a..ed7bf0965a4 100644
--- a/content/zh-cn/overview/mannual/golang-sdk/refer/nacos.md
+++ b/content/zh-cn/overview/mannual/golang-sdk/refer/nacos.md
@@ -2,146 +2,105 @@
aliases:
- /zh/docs3-v2/golang-sdk/tutorial/develop/registry/nacos/
- /zh-cn/docs3-v2/golang-sdk/tutorial/develop/registry/nacos/
-description: 使用 Nacos 作为注册中心
+description: 当前 Dubbo Go 中使用 Nacos 作为注册中心
title: 使用 Nacos 作为注册中心
type: docs
weight: 10
---
+相关示例:
+* Nacos 注册中心示例:<a href="https://github.com/apache/dubbo-go-samples/tree/main/registry/nacos" target="_blank">dubbo-go-samples/registry/nacos</a>
+* 应用级服务发现参考:<a href="https://github.com/apache/dubbo-go-samples/tree/main/registry/nacos" target="_blank">dubbo-go-samples/registry/nacos</a>
-## 1. 准备工作
+另见:
-- dubbo-go cli 工具和依赖工具已安装
-- 创建一个新的 demo 应用
+* [应用级服务发现](/zh-cn/overview/mannual/golang-sdk/tutorial/service-discovery/application-level-service-discovery/)
+* [工具:dubbogo-cli](/zh-cn/overview/mannual/golang-sdk/tools/dubbogo-cli/)
-## 2. 使用 grpc_cli 工具进行 Dubbo 服务调试
+这个页面用于说明当前 Dubbo Go 中如何把 Nacos 作为注册中心来使用。它的旧版本主要在讲 CLI 调试流程,但那已经不是现在 Nacos 集成页的核心内容了。
-### 2.1 开启服务端
-示例:user.go:
-```go
-func (u *UserProvider) GetUser(ctx context.Context, userStruct *CallUserStruct) (*User, error) {
- fmt.Printf("=======================\nreq:%#v\n", userStruct)
- rsp := User{"A002", "Alex Stocks", 18, userStruct.SubInfo}
- fmt.Printf("=======================\nrsp:%#v\n", rsp)
- return &rsp, nil
-}
+## 这个示例展示了什么
-```
-服务端开启一个服务,名为GetUser,传入一个CallUserStruct的参数,返回一个User参数\
-CallUserStruct参数定义:
-```go
-type CallUserStruct struct {
- ID string
- Male bool
- SubInfo SubInfo // 嵌套子结构
-}
-func (cs CallUserStruct) JavaClassName() string {
- return "com.ikurento.user.CallUserStruct"
-}
-
-type SubInfo struct {
- SubID string
- SubMale bool
- SubAge int
-}
-
-func (s SubInfo) JavaClassName() string {
- return "com.ikurento.user.SubInfo"
-}
+当前 `registry/nacos` sample 主要展示:
-```
-User结构定义:
-```go
-type User struct {
- Id string
- Name string
- Age int32
- SubInfo SubInfo // 嵌套上述子结构SubInfo
-}
-
-func (u *User) JavaClassName() string {
- return "com.ikurento.user.User"
-}
+* provider 注册到 Nacos
+* consumer 通过 Nacos 发现服务
+* 基于 Triple 的 RPC 调用链路
+* Go 应用中基于注册中心的服务发现
+
+示例目录主要包括:
+
+* `go-server/cmd/server.go`
+* `go-client/cmd/client.go`
+* `proto/greet.proto`
+
+## 启动 Nacos
+
+首先启动一个可用的 Nacos 服务,并确保 Dubbo Go 应用能够访问它。sample README 使用的是标准 Nacos 服务和默认控制台。
+
+## 启动 Provider
+
+在 sample 目录下运行:
+
+```bash
+go run ./go-server/cmd/server.go
```
-开启服务:
-
-`cd server `\
-`source builddev.sh`\
-`go run .`
-
-### 2.2 定义请求体(打解包协议)
-
-请求体定义为json文件,约定键值均为string\
-键对应go语言struct字段名例如"ID"、"Name" ,值对应"type@val"\
-其中type支持string int bool time,val使用string 来初始化,如果只填写type则初始化为零值。
-约定每个struct必须有JavaClassName字段,务必与server端严格对应
-
-见userCall.json:
-```json
-{
- "ID": "string@A000",
- "Male": "bool@true",
- "SubInfo": {
- "SubID": "string@A001",
- "SubMale": "bool@false",
- "SubAge": "int@18",
- "JavaClassName":"string@com.ikurento.user.SubInfo"
- },
- "JavaClassName": "string@com.ikurento.user.CallUserStruct"
-}
+provider 启动后会暴露服务,并把实例注册到 Nacos。
+
+你也可以用一个 HTTP 请求先验证服务已经起来:
+
+```bash
+curl \
+ --header "Content-Type: application/json" \
+ --data '{"name": "Dubbo"}' \
+ http://localhost:20000/greet.GreetService/Greet
```
-userCall.json将参数CallUserStruct的结构及子结构SubInfo都定义了出来,并且给请求参数赋值。
-
-user.json 同理,作为返回值不需要赋初始值,但JavaClassName字段一定与server端严格对应
-```go
-{
- "ID": "string",
- "Name": "string",
- "Age": "int",
- "JavaClassName": "string@com.ikurento.user.User",
- "SubInfo": {
- "SubID": "string",
- "SubMale": "bool",
- "SubAge": "int",
- "JavaClassName":"string@com.ikurento.user.SubInfo"
- }
-}
+
+## 启动 Consumer
+
+然后运行:
+
+```bash
+go run ./go-client/cmd/client.go
```
-### 2.3 执行请求
-`dubbogo-cli call --h=localhost --p 20001 --proto=dubbo --i=com.ikurento.user.UserProvider --method=GetUser --sendObj="./userCall.json" --recvObj="./user.json"`
+consumer 会先通过 Nacos 解析目标服务,再发起 RPC 调用。
-cli端打印结果:
-```log
-2020/10/26 20:47:45 Created pkg:
-2020/10/26 20:47:45 &{ID:A000 Male:true SubInfo:0xc00006ea20 JavaClassName:com.ikurento.user.CallUserStruct}
-2020/10/26 20:47:45 SubInfo:
-2020/10/26 20:47:45 &{SubID:A001 SubMale:false SubAge:18 JavaClassName:com.ikurento.user.SubInfo}
+## 配置形态
+在当前 Dubbo Go 中,Nacos 可能出现在几个不同层次的配置里:
-2020/10/26 20:47:45 Created pkg:
-2020/10/26 20:47:45 &{ID: Name: Age:0 JavaClassName:com.ikurento.user.User SubInfo:0xc00006ec90}
-2020/10/26 20:47:45 SubInfo:
-2020/10/26 20:47:45 &{SubID: SubMale:false SubAge:0 JavaClassName:com.ikurento.user.SubInfo}
+* 实例级:`dubbo.WithRegistry(registry.WithNacos(), ...)`
+* 引用级:`client.WithRegistry(...)` 或 `client.WithRegistryIDs(...)`
+* 服务级:`server.WithRegistry(...)` 或 `server.WithRegistryIDs(...)`
+* 配置文件模式:`registries` 节点
+常用 registry 选项来自 `registry/options.go`,包括:
-2020/10/26 20:47:45 connected to localhost:20001!
-2020/10/26 20:47:45 try calling interface:com.ikurento.user.UserProvider.GetUser
-2020/10/26 20:47:45 with protocol:dubbo
+* `registry.WithNacos()`
+* `registry.WithAddress(...)`
+* `registry.WithGroup(...)`
+* `registry.WithNamespace(...)`
+* `registry.WithRegisterService()`
+* `registry.WithRegisterInterface()`
+* `registry.WithRegisterServiceAndInterface()`
-2020/10/26 20:47:45 After 3ms , Got Rsp:
-2020/10/26 20:47:45 &{ID:A002 Name:Alex Stocks Age:18 JavaClassName: SubInfo:0xc0001241b0}
-2020/10/26 20:47:45 SubInfo:
-2020/10/26 20:47:45 &{SubID:A001 SubMale:false SubAge:18 JavaClassName:}```
-```
-可看到详细的请求体赋值情况,以及返回结果和耗时。支持嵌套结构
+## 应用级服务发现
-server端打印结果
-```
-=======================
-req:&main.CallUserStruct{ID:"A000", Male:true, SubInfo:main.SubInfo{SubID:"A001", SubMale:false, SubAge:18}}
-=======================
-```
-可见接收到了来自cli的数据
\ No newline at end of file
+在当前 Dubbo Go 部署里,Nacos 很常和应用级服务发现一起使用。在这个模型下:
+
+* provider 注册应用实例和 metadata;
+* consumer 先解析 service 到 application 的映射;
+* 再通过 metadata 还原出可调用的服务端点。
+
+如果你正在判断要不要继续用旧的接口级注册模型,建议先从上面链接的“应用级服务发现”页面看起。
+
+## 关于 dubbogo-cli
+
+`dubbogo-cli` 依然可以用于调试和互通场景,但它不再是 Nacos 注册中心页面的主体内容。如果你需要 CLI,请从下面的位置安装:
+
+* [apache/dubbo-go/tools/dubbogo-cli](https://github.com/apache/dubbo-go/tree/main/tools/dubbogo-cli)
+
+然后参考独立的 tools 页面。
diff --git a/content/zh-cn/overview/mannual/golang-sdk/refer/sourcecode/3.0_feature.md b/content/zh-cn/overview/mannual/golang-sdk/refer/sourcecode/3.0_feature.md
deleted file mode 100644
index 1fde5e38933..00000000000
--- a/content/zh-cn/overview/mannual/golang-sdk/refer/sourcecode/3.0_feature.md
+++ /dev/null
@@ -1,80 +0,0 @@
----
-aliases:
- - /zh/docs3-v2/golang-sdk/preface/3.0_feature/
- - /zh-cn/docs3-v2/golang-sdk/preface/3.0_feature/
- - /zh-cn/overview/mannual/golang-sdk/preface/3.0_feature/
-description: Dubbo-go 3.0 新特性
-keywords: 新特性
-title: 新特性
-type: docs
-weight: 3
----
-
-
-
-
-
-
-
-
-## 1. Triple 协议
-
-### 1.1 概述
-
-
-
-- 通信层面
-
- Triple 协议,也称为Dubbo3协议,是基于HTTP2 + gRPC协议,增加特定字段和逻辑的扩展协议,保证了和**原生gRPC协议互通**。在此基础之上,Triple 新协议将更原生地支持 **Dubbo 服务治理能力**。并支持**流式RPC调用**。
-
- 简单来说,可以理解为 Triple = gRPC + Dubbo
-
-- 序列化
-
- Triple 协议使用高效的**PB序列化方式**,并在此基础之上增加序列化协议的**可扩展支持**。
-
-- 用户开发习惯:
-
- Triple 服务在开发前需要**预定义.proto文件**,对于习惯在编码前先定义IDL的Go语言开发者带来便捷。不同于符合java编程习惯的,定义JavaClassName用于描述接口的 Dubbo-go 1.x版本。
-
-- 跨语言互通性:
-
- 可与 Dubbo-Java 实现**跨语言互通**。
-
-
-## 2. 应用级服务发现
-
-### 2.1 简介
-
-
-
-在服务注册阶段,服务端实例将应用级别的注册信息,主要包含从应用名到实例IP的映射注册到注册中心。在服务发现阶段,客户端实例,通过注册中心获取到需要请求的服务实例IP。进入服务自省阶段,服务自省过程为通过应用信息获取接口信息的过程。如上图,包含两种模式:
-
-1. remote模式:通过元数据中心(例如 zk )获取应用到接口元数据的映射
-2. local模式:直接通过服务端获取应用到接口元数据的映射(通过 Dubbo 协议针对 Metadata Service 发起 RPC 调用)
-
-经过服务自省后,客户端正式向对应实例发起调用。这样做最明显的好处是减少了注册中心的数据量,即注册中心只保存了应用级别的数据。
-
-用户在使用 Dubbo-go 3.0的应用级服务发现能力时,可以仿照示例,直接在配置文件中配置服务自省模式和元数据中心信息,引入依赖,开启应用级别服务发现。
-
-### 2.2 应用级服务发现介绍文章
-
-[应用级服务发现解析](https://baijiahao.baidu.com/s?id=1669266413887039723&wfr=spider&for=pc)
-
-## 3. Mesh 路由规则
-
-用户可定义路由文件:
-
-virtual_service.yaml
-
-
-
-以及 dist_rule.yml
-
-
-
-框架可根据路由文件针对特定的请求进行流量转发。
-
-## 4. 相关文章
-
-阿里云官方介绍文章:[《Dubbo 3.0 - 开启下一代云原生微服务》](https://developer.aliyun.com/article/770964?utm_content=g_1000175535)
\ No newline at end of file
diff --git a/content/zh-cn/overview/mannual/golang-sdk/refer/sourcecode/_index.md b/content/zh-cn/overview/mannual/golang-sdk/refer/sourcecode/_index.md
deleted file mode 100644
index 2e93b505de1..00000000000
--- a/content/zh-cn/overview/mannual/golang-sdk/refer/sourcecode/_index.md
+++ /dev/null
@@ -1,10 +0,0 @@
----
-aliases:
- - /zh/docs3-v2/golang-sdk/sourcecode/
- - /zh-cn/docs3-v2/golang-sdk/sourcecode/
- - /zh-cn/overview/mannual/golang-sdk/sourcecode/
-description: Dubbo-go 源码解读
-title: 源码解读
-type: docs
-weight: 4
----
diff --git a/content/zh-cn/overview/mannual/golang-sdk/refer/sourcecode/aop_and_extension.md b/content/zh-cn/overview/mannual/golang-sdk/refer/sourcecode/aop_and_extension.md
deleted file mode 100644
index d7bb5af3a3d..00000000000
--- a/content/zh-cn/overview/mannual/golang-sdk/refer/sourcecode/aop_and_extension.md
+++ /dev/null
@@ -1,111 +0,0 @@
----
-aliases:
- - /zh/docs3-v2/golang-sdk/preface/design/aop_and_extension/
- - /zh-cn/docs3-v2/golang-sdk/preface/design/aop_and_extension/
- - /zh-cn/overview/mannual/golang-sdk/preface/design/aop_and_extension/
-description: AOP 与可扩展机制
-keywords: AOP 与可扩展机制
-title: AOP 与可扩展机制
-type: docs
----
-
-## 1. extension 模块与 init 方法
-
-### 1.1 接口与实现
-
-golang 中的一个接口往往伴随多个实现类,dubbo-go 提供了针对接口实现类的可插拔可扩展机制。降低模块之间的耦合性,方便开发者引入、自定义组件。
-
-### 1.2 golang 中的 init 方法
-
-init 方法作为 golang 中特殊的方法,用户引入一组模块后,会在程序启动时率先执行这些模块内的init 方法,进行加载逻辑,该方法是dubbogo注册扩展组件的重要方式。
-
-### 1.3 extension 模块
-
-在框架源码中,有一个特殊的模块: common/extension ,这一模块负责缓存所有可扩展组件的实现。
-
-以负载均衡模块为例:common/extension/loadbalance.go
-
-```go
-package extension
-
-import (
- "dubbo.apache.org/dubbo-go/v3/cluster/loadbalance"
-)
-
-var loadbalances = make(map[string]func() loadbalance.LoadBalance)
-
-// SetLoadbalance sets the loadbalance extension with @name
-// For example: random/round_robin/consistent_hash/least_active/...
-func SetLoadbalance(name string, fcn func() loadbalance.LoadBalance) {
- loadbalances[name] = fcn
-}
-
-// GetLoadbalance finds the loadbalance extension with @name
-func GetLoadbalance(name string) loadbalance.LoadBalance {
- if loadbalances[name] == nil {
- panic("loadbalance for " + name + " is not existing, make sure you have import the package.")
- }
-
- return loadbalances[name]()
-}
-```
-
-该模块包含Get 方法和Set方法。Get 返回实例化的 LoadBalance 接口,Set 方法用于注册工厂函数,map 用于缓存工厂函数。
-
-当用户引入 _ "dubbo.apache.org/dubbo-go/v3/cluster/loadbalance/random" 时,将会加载对应模块的init函数,调用 Set 方法注册唯一key和工厂函数和到上述map中。
-
-cluster/loadbalance/random/loadbalance.go
-
-```go
-package random
-
-import (
- "math/rand"
-)
-
-import (
- "dubbo.apache.org/dubbo-go/v3/cluster/loadbalance"
- "dubbo.apache.org/dubbo-go/v3/common/constant"
- "dubbo.apache.org/dubbo-go/v3/common/extension"
- "dubbo.apache.org/dubbo-go/v3/protocol"
-)
-
-func init() {
- extension.SetLoadbalance(constant.LoadBalanceKeyRandom, NewRandomLoadBalance)
-}
-```
-
-至此,当所有init方法执行完毕,可以通过 extension 模块 Get 方法来获取实例化对象。
-
-### 1.4 imports 模块
-
-dubbogo 将所有内置的模块全部放置在 imports/imports.go 内,用户在使用框架时,需要引入该模块,从而使用框架提供的基础能力。
-
-```go
-import (
- _ "dubbo.apache.org/dubbo-go/v3/imports"
-)
-```
-
-## 2. 组件加载流程
-
-1. 用户在代码中引入 _ "dubbo.apache.org/dubbo-go/v3/imports"
-
-2. 程序启动,init 函数被依次执行,注册工厂函数/实例化对象到 extension 模块。
-
-3. 框架启动,加载配置,配置中获取需要加载的模块key,根据key获取实例化对象。
-
-4. 用户也可以手动调用 extension 的 Get 方法,获取实例化对象并直接使用。
-
-## 3. 自定义组件
-
-在上述介绍的基础之上,开发人员可以效仿内置模块,编写自定义扩展组件。
-
-
-## 4. 面向切面编程的设计(AOP)
-
-在 Dubbo-go 服务框架中,许多接口是基于 AOP 的思路进行设计的。例如 Invoker、Filter、LoadBalance、Router。
-
-这些接口的多种实现往往组成一组调用链,单个实现类只处理自己所关注的逻辑。
-
-相关阅读:[【AOP wikipedia】](https://en.wikipedia.org/wiki/Aspect-oriented_programming)
\ No newline at end of file
diff --git a/content/zh-cn/overview/mannual/golang-sdk/refer/sourcecode/app_and_interface.md b/content/zh-cn/overview/mannual/golang-sdk/refer/sourcecode/app_and_interface.md
deleted file mode 100644
index 80561c645b1..00000000000
--- a/content/zh-cn/overview/mannual/golang-sdk/refer/sourcecode/app_and_interface.md
+++ /dev/null
@@ -1,74 +0,0 @@
----
-aliases:
- - /zh/docs3-v2/golang-sdk/preface/design/app_and_interface/
- - /zh-cn/docs3-v2/golang-sdk/preface/design/app_and_interface/
- - /zh-cn/overview/mannual/golang-sdk/preface/design/app_and_interface/
-description: Dubbo的应用和接口
-keywords: 基本概念
-title: Dubbo的应用和接口
-type: docs
----
-
-
-
-
-
-
-## Dubbogo 服务层级
-
-Dubbogo 服务层级为两个级别:分别是应用级别(App Level)和接口级别(Interface Level),该服务分层与**框架配置**结构息息相关。
-
-如下图所示,可以看到,应用级别的组件以浅红色标注,接口级别的组件以浅蓝色标注:
-
-
-
-## 1. 应用级别组件
-
-应用级别组件的特点:被当前应用的所有接口级别组件共用。
-
-应用级别的主要组件如下:
-
-- 应用信息模块
-
- 包含应用维度相关信息,包括应用名、版本号、数据上报方式等
-
-- Consumer 模块
-
- Consumer 模块负责客户端相关信息,包括一个或多个引用(Reference)结构,以及超时、客户端过滤器(consumer filter)等相关信息。
-
-- Provider 模块
-
- Provider 模块负责服务端相关信息,包括一个或多个服务(Service)结构、服务端过滤器(provider filter)等相关信息。
-
-- 注册中心(Registry)模块
-
- 注册中心模块负责定义好所要使用的一系列注册中心,例如框架支持的ZK、Nacos、ETCD等中间件。应用级别的注册模块只负责声明,由接口级别的组件进行引用,引用时以用户自定义的注册中心ID(registryID) 作为索引。
-
-- 协议(Protocol)模块
-
- 协议模块只存在于服务端。
-
- 协议模块关心服务的暴露信息,例如协议名、服务监听IP、端口号等信息。协议模块属于应用级别,只负责声明,由接口级别的组件进行引用,引用时以用户自定义的协议ID(protocolID) 作为索引。
-
-- 元数据中心模块
-
- 元数据中心类似于注册中心模块,负责声明框架需要使用的元数据中心,从而将元数据成功上报。
-
-- 配置中心模块
-- 路由模块
-- 日志模块
-- 监控模块
-
-## 2. 接口级别组件
-
-- 服务(Service)模块
-
- 服务模块被使用于任何暴露的服务,声明接口暴露所需的信息,包括例如接口名、协议、序列化方式等,负责单个服务接口的暴露。
-
-- 引用(Reference)模块
-
- 引用模块被使用于需要调用的远程服务的客户端,其声明了需要请求接口所需的信息,包括例如接口名、协议、序列化方式等、负责特定协议的抽象,参与客户端的生成。
-
-## 3. 说明
-
-暴露的服务是接口级别的,一个用户定义的 Provider Struct/一个用户定义的Consumer Struct,对应一个Service/Reference 模块,一个应用可以同时存在Consumer 模块和 Provider 模块,因此可以同时存在多个Service/Reference 模块。
diff --git a/content/zh-cn/overview/mannual/golang-sdk/refer/sourcecode/architecture.md b/content/zh-cn/overview/mannual/golang-sdk/refer/sourcecode/architecture.md
deleted file mode 100644
index 261badbc921..00000000000
--- a/content/zh-cn/overview/mannual/golang-sdk/refer/sourcecode/architecture.md
+++ /dev/null
@@ -1,31 +0,0 @@
----
-aliases:
- - /zh/docs3-v2/golang-sdk/preface/design/architecture/
- - /zh-cn/docs3-v2/golang-sdk/preface/design/architecture/
- - /zh-cn/overview/mannual/golang-sdk/preface/design/architecture/
-description: 架构
-keywords: 架构
-title: 架构
-type: docs
----
-
-
-
-
-
-
-### 架构说明
-
-
-
-### 节点说明
-
-* `Registry` : dubbo-go中负责服务注册与发现的注册中心
-* `Consumer` : 调用远程服务的服务消费方
-* `Provider` : 暴露服务的服务提供方
-
-### 过程说明
-* `0. register` : 当服务提供方在启动的时候,会自动将自己的服务注册到注册中心
-* `1. subscribe` : 服务消费方会在启动的时候,向注册中心订阅自己所需要的服务
-* `2. notify` : 注册中心返回服务注册的信息给到服务消费方,当订阅的服务发生变更,会推送变更的数据给到消费方
-* `3. invoke` : 服务消费者根据从注册中心获得的服务地址,经过负载均衡算法选出一个合适的服务地址发起请求
\ No newline at end of file
diff --git a/content/zh-cn/overview/mannual/golang-sdk/refer/sourcecode/generic-2.md b/content/zh-cn/overview/mannual/golang-sdk/refer/sourcecode/generic-2.md
deleted file mode 100644
index babff85cb72..00000000000
--- a/content/zh-cn/overview/mannual/golang-sdk/refer/sourcecode/generic-2.md
+++ /dev/null
@@ -1,112 +0,0 @@
----
-aliases:
- - /zh/docs3-v2/golang-sdk/tutorial/develop/features/generic/
- - /zh-cn/docs3-v2/golang-sdk/tutorial/develop/features/generic/
- - /zh/docs3-v2/golang-sdk/tutorial/develop/features/generic-2/
- - /zh-cn/docs3-v2/golang-sdk/tutorial/develop/features/generic-2/
- - /zh-cn/overview/mannual/golang-sdk/tutorial/develop/features/generic/
-description: 泛化调用
-title: 泛化调用
-type: docs
-weight: 8
----
-
-
-
-
-
-
-## 1. Dubbogo 泛化调用 Java Server
-
-使用 Triple 协议 + hessian2 序列化方案
-
-可参考Dubbogo 3.0 [泛化调用文档](https://www.yuque.com/docs/share/f4e72670-74ab-45b9-bc0c-4b42249ed953?#)
-
-### 1.1 Java-Server启动
-
-1. 传输结构定义
-
-```java
-package org.apache.dubbo;
-
-import java.io.Serializable;
-import java.util.Date;
-
-public class User implements Serializable {
- private String id;
-
- private String name;
-
- private int age;
-
- private Date time = new Date();
-}
-```
-
-2. 接口定义
-
-```java
-package org.apache.dubbo;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-//import org.apache.dubbo.rpc.filter.GenericFilter;
-
-public interface UserProvider {
- User GetUser1(String userId);
-}
-```
-
-### 1.2 Go-Client 泛化调用
-
-此处展示以 API 的形式构造泛化接口引用
-
-```go
-// 初始化 Reference 配置
-refConf := config.NewReferenceConfigBuilder().
- SetInterface("org.apache.dubbo.UserProvider").
- SetRegistryIDs("zk").
- SetProtocol(tripleConst.TRIPLE).
- SetGeneric(true).
- SetSerialization("hessian2").
- Build()
-
-// 构造 Root 配置,引入注册中心模块
-rootConfig := config.NewRootConfigBuilder().
- AddRegistry("zk", config.NewRegistryConfigWithProtocolDefaultPort("zookeeper")).
- Build()
-
-// Reference 配置初始化,因为需要使用注册中心进行服务发现,需要传入经过配置的 rootConfig
-if err := refConf.Init(rootConfig); err != nil{
- panic(err)
-}
-
-// 泛化调用加载、服务发现
-refConf.GenericLoad(appName)
-
-time.Sleep(time.Second)
-
-// 发起泛化调用
-resp, err := refConf.GetRPCService().(*generic.GenericService).Invoke(
- context.TODO(),
- "getUser1",
- []string{"java.lang.String"},
- []hessian.Object{"A003"},
-)
-
-if err != nil {
- panic(err)
-}
-logger.Infof("GetUser1(userId string) res: %+v", resp)
-```
-
-GenericService 的 Invoke 方法包括三个参数:context.Context, []string, []hessian.Object,
-
-其中第二个参数为对应参数的 Java 类名,例如java.lang.String、org.apache.dubbo.User,第三个参数为参数列表,hessian.Object 即为 interface。第二、第三个参数应与方法签名一致,按顺序对应。
-
-获得map结构的返回结果
-
-```
-INFO cmd/client.go:89 GetUser1(userId string) res: map[age:48 class:org.apache.dubbo.User id:A003 name:Joe sex:MAN time:2021-10-04 14:03:03.37 +0800 CST]
-```
diff --git a/content/zh-cn/overview/mannual/golang-sdk/refer/sourcecode/generic.md b/content/zh-cn/overview/mannual/golang-sdk/refer/sourcecode/generic.md
deleted file mode 100644
index 0b73538e8d5..00000000000
--- a/content/zh-cn/overview/mannual/golang-sdk/refer/sourcecode/generic.md
+++ /dev/null
@@ -1,107 +0,0 @@
----
-aliases:
- - /zh/docs3-v2/golang-sdk/tutorial/develop/features/generic/
- - /zh-cn/docs3-v2/golang-sdk/tutorial/develop/features/generic/
-description: 泛化调用
-title: 泛化调用
-type: docs
-weight: 7
----
-
-
-
-
-
-
-## 1. Dubbo-go 泛化调用 Java Server
-
-使用 Triple 协议 + hessian2 序列化方案
-
-### 1.1 Java-Server启动
-
-1. 传输结构定义
-
-```java
-package org.apache.dubbo;
-
-import java.io.Serializable;
-import java.util.Date;
-
-public class User implements Serializable {
- private String id;
-
- private String name;
-
- private int age;
-
- private Date time = new Date();
-}
-```
-
-2. 接口定义
-
-```java
-package org.apache.dubbo;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-//import org.apache.dubbo.rpc.filter.GenericFilter;
-
-public interface UserProvider {
- User GetUser1(String userId);
-}
-```
-
-### 1.2 Go-Client 泛化调用
-
-此处展示以 API 的形式构造泛化接口引用
-
-```go
-// 初始化 Reference 配置
-refConf := config.NewReferenceConfigBuilder().
- SetInterface("org.apache.dubbo.UserProvider").
- SetRegistryIDs("zk").
- SetProtocol(tripleConst.TRIPLE).
- SetGeneric(true).
- SetSerialization("hessian2").
- Build()
-
-// 构造 Root 配置,引入注册中心模块
-rootConfig := config.NewRootConfigBuilder().
- AddRegistry("zk", config.NewRegistryConfigWithProtocolDefaultPort("zookeeper")).
- Build()
-
-// Reference 配置初始化,因为需要使用注册中心进行服务发现,需要传入经过配置的 rootConfig
-if err := refConf.Init(rootConfig); err != nil{
- panic(err)
-}
-
-// 泛化调用加载、服务发现
-refConf.GenericLoad(appName)
-
-time.Sleep(time.Second)
-
-// 发起泛化调用
-resp, err := refConf.GetRPCService().(*generic.GenericService).Invoke(
- context.TODO(),
- "getUser1",
- []string{"java.lang.String"},
- []hessian.Object{"A003"},
-)
-
-if err != nil {
- panic(err)
-}
-logger.Infof("GetUser1(userId string) res: %+v", resp)
-```
-
-GenericService 的 Invoke 方法包括三个参数:context.Context, []string, []hessian.Object,
-
-其中第二个参数为对应参数的 Java 类名,例如java.lang.String、org.apache.dubbo.User,第三个参数为参数列表,hessian.Object 即为 interface。第二、第三个参数应与方法签名一致,按顺序对应。
-
-获得map结构的返回结果
-
-```
-INFO cmd/client.go:89 GetUser1(userId string) res: map[age:48 class:org.apache.dubbo.User id:A003 name:Joe sex:MAN time:2021-10-04 14:03:03.37 +0800 CST]
-```
\ No newline at end of file
diff --git a/content/zh-cn/overview/mannual/golang-sdk/refer/sourcecode/protocol.md b/content/zh-cn/overview/mannual/golang-sdk/refer/sourcecode/protocol.md
deleted file mode 100644
index 0b16486364a..00000000000
--- a/content/zh-cn/overview/mannual/golang-sdk/refer/sourcecode/protocol.md
+++ /dev/null
@@ -1,33 +0,0 @@
----
-aliases:
- - /zh/docs3-v2/golang-sdk/sourcecode/protocol/
- - /zh-cn/docs3-v2/golang-sdk/sourcecode/protocol/
-description: 网络协议源码解读
-title: 网络协议
-type: docs
-weight: 1
----
-
-
-
-
-
-
-对于 Dubbogo 微服务框架,网络协议为远程过程调用中负责网络通信的模块,负责应用层到网络层的数据序列化、打包、请求发起、网络端口监听等功能。Dubbogo 为协议抽象了一套接口如下:
-
-```go
-type Protocol interface {
- // Export service for remote invocation
- Export(invoker Invoker) Exporter
- // Refer a remote service
- Refer(url *common.URL) Invoker
- // Destroy will destroy all invoker and exporter, so it only is called once.
- Destroy()
-}
-```
-
-该接口包含三个方法。其中 Export 方法负责服务的暴露过程。入参 invoker 为dubbo 的概念,其封装了一个可以被调用的实例。在具体网络协议(例如Triple)实现的 Export 方法中,会针对特定的协议,将封装有一定逻辑的可调用实例 Invoker 以网络端口监听的形式暴露给外部服务,来自外部针对该网络端口的请求将会被 Export 方法开启的监听协程获取,进而根据网络协议进行拆解包和反序列化,得到解析后的请求数据。
-
-Refer 方法负责服务的引用过程,其入参 url 为 dubbo 框架通用的结构,可以描述一个希望引用的服务,url 参数中包含了多个希望引用服务的参数,例如对应服务的接口名(interface),版本号(version),使用协议(protocol) 等等。在具体网络协议(例如Triple)实现的 Refer 方法中,会将特定的网络协议封装到 Invoker 可调用实例的方法中,用户层发起的 RPC 调用即可直接通过返回的 Invoker 对象,发起特定协议的网络请求。
-
-Destroy 方法作用为销毁当前暴露的服务,用于服务下线场景。Dubbogo 框架有优雅下线机制,可以在服务进程终止前以监听信号的形式,下线所有已启动的服务。
\ No newline at end of file
diff --git a/content/zh-cn/overview/mannual/golang-sdk/refer/sourcecode/registry.md b/content/zh-cn/overview/mannual/golang-sdk/refer/sourcecode/registry.md
deleted file mode 100644
index 1017aad4ea0..00000000000
--- a/content/zh-cn/overview/mannual/golang-sdk/refer/sourcecode/registry.md
+++ /dev/null
@@ -1,61 +0,0 @@
----
-aliases:
- - /zh/docs3-v2/golang-sdk/sourcecode/registry/
- - /zh-cn/docs3-v2/golang-sdk/sourcecode/registry/
-description: 注册中心源码解读
-title: 注册中心
-type: docs
-weight: 1
----
-
-
-
-
-
-
-Dubbogo 为注册中心抽象了一套接口如下:
-
-```go
-// Registry Extension - Registry
-type Registry interface {
- common.Node
-
- // Register is used for service provider calling, register services
- // to registry. And it is also used for service consumer calling, register
- // services cared about, for dubbo's admin monitoring.
- Register(url *common.URL) error
-
- // UnRegister is required to support the contract:
- // 1. If it is the persistent stored data of dynamic=false, the
- // registration data can not be found, then the IllegalStateException
- // is thrown, otherwise it is ignored.
- // 2. Unregister according to the full url match.
- // url Registration information, is not allowed to be empty, e.g:
- // dubbo://10.20.153.10/org.apache.dubbo.foo.BarService?version=1.0.0&application=kylin
- UnRegister(url *common.URL) error
-
- // Subscribe is required to support the contract:
- // When creating new registry extension, pls select one of the
- // following modes.
- // Will remove in dubbogo version v1.1.0
- // mode1: return Listener with Next function which can return
- // subscribe service event from registry
- // Deprecated!
- // subscribe(event.URL) (Listener, error)
- // Will replace mode1 in dubbogo version v1.1.0
- // mode2: callback mode, subscribe with notify(notify listener).
- Subscribe(*common.URL, NotifyListener) error
-
- // UnSubscribe is required to support the contract:
- // 1. If don't subscribe, ignore it directly.
- // 2. Unsubscribe by full URL match.
- // url Subscription condition, not allowed to be empty, e.g.
- // consumer://10.20.153.10/org.apache.dubbo.foo.BarService?version=1.0.0&application=kylin
- // listener A listener of the change event, not allowed to be empty
- UnSubscribe(*common.URL, NotifyListener) error
-}
-```
-
-该接口主要包含四个方法,分别是注册、反注册、订阅、取消订阅。顾名思义,概括了客户端和服务端与注册中心交互的动作。针对普通接口级服务注册发现场景,在Provider 服务启动时,会将自身服务接口信息抽象为一个 url,该 url 包含了客户端发起调用所需的所有信息(ip、端口、协议等),服务端的注册中心组件会将该 url 写入注册中心(例如zk)。客户端启动后,在服务引用 Refer 步骤会通过注册中心组件订阅(Subscribe)需要的服务信息,获取到的服务信息以异步事件更新的形式写入客户端缓存,从而在服务发现成功后,可以根据拿到的服务 url 参数,向对应服务提供者发起调用。
-
-##
\ No newline at end of file
diff --git a/content/zh-cn/overview/mannual/golang-sdk/sourcecode/3.0_feature.md b/content/zh-cn/overview/mannual/golang-sdk/sourcecode/3.0_feature.md
new file mode 100644
index 00000000000..86a0722b1c8
--- /dev/null
+++ b/content/zh-cn/overview/mannual/golang-sdk/sourcecode/3.0_feature.md
@@ -0,0 +1,76 @@
+---
+aliases:
+ - /zh/docs3-v2/golang-sdk/preface/3.0_feature/
+ - /zh-cn/docs3-v2/golang-sdk/preface/3.0_feature/
+ - /zh-cn/overview/mannual/golang-sdk/preface/3.0_feature/
+ - /zh-cn/overview/mannual/golang-sdk/refer/sourcecode/3.0_feature/
+description: 当前 Dubbo Go 3.x 核心能力
+keywords: 新特性
+title: 3.x 核心能力
+type: docs
+weight: 3
+---
+
+相关示例:
+
+* Triple 协议:<a href="https://github.com/apache/dubbo-go-samples/tree/main/rpc/triple" target="_blank">dubbo-go-samples/rpc/triple</a>
+* 基于 Nacos 的应用级服务发现:<a href="https://github.com/apache/dubbo-go-samples/tree/main/registry/nacos" target="_blank">dubbo-go-samples/registry/nacos</a>
+* Service Mesh 部署:<a href="https://github.com/apache/dubbo-go-samples/tree/main/mesh" target="_blank">dubbo-go-samples/mesh</a>
+
+Dubbo Go 3.x 的核心能力已经围绕 Triple 协议、应用级服务发现、metadata 驱动的服务自省,以及 SDK 侧治理能力展开。这些内容不再只是 3.0 版本的新特性,而是当前 Dubbo Go 应用的常规开发模型。
+
+## Triple 协议
+
+Triple 是 Dubbo Go 3.x 推荐使用的 RPC 协议,主要实现位于:
+
+* `protocol/triple`
+* `protocol/triple/triple_protocol`
+* `tools/protoc-gen-go-triple`
+
+Triple 基于 HTTP/1.1 和 HTTP/2 语义,并在线路协议上兼容 gRPC。对于 protobuf 服务,用户先定义 `.proto` 文件,再通过 `protoc-gen-go` 和 `protoc-gen-go-triple` 生成 Go 代码,最后将生成的 handler 注册到 Dubbo Go server。
+
+运行时链路遵循 Dubbo 通用协议抽象:
+
+* provider 侧:`server.Register(...)` 构造 service options 和 invoker,再通过协议 `Export` 暴露服务;
+* consumer 侧:生成的 client 调用 `client.Connection`,由它构造 invocation 并委托给协议 `Refer` 返回的 invoker;
+* request header、response header、trailer 等 metadata 通过 Triple metadata API 暴露。
+
+## 应用级服务发现
+
+应用级服务发现是当前 Dubbo Go 默认的服务发现模型。provider 注册应用实例和 metadata;consumer 解析 service 到 application 的映射,再通过 metadata 还原可调用的服务 URL。
+
+重要代码入口包括:
+
+* `registry/options.go`:`WithRegisterService`、`WithRegisterInterface`、`WithRegisterServiceAndInterface` 等 registry type 选项;
+* `registry/servicediscovery`:应用级注册和订阅;
+* `metadata/report` 和 `metadata/mapping`:metadata 上报和 service-name mapping;
+* `options.go`:`WithRemoteMetadata`、`WithMetadataServiceProtocol` 等实例级 metadata 选项。
+
+注册模式有三种:
+
+| 模式 | API | 含义 |
+| --- | --- | --- |
+| `service` | `registry.WithRegisterService()` | 注册应用级实例,推荐作为默认模式。 |
+| `interface` | `registry.WithRegisterInterface()` | 注册接口级 provider URL。 |
+| `all` | `registry.WithRegisterServiceAndInterface()` | 迁移阶段同时注册两种模型。 |
+
+详细行为和默认值见 [应用级服务发现](/zh-cn/overview/mannual/golang-sdk/tutorial/service-discovery/application-level-service-discovery/)。
+
+## Metadata 模式
+
+应用级服务发现需要 provider metadata。Dubbo Go 支持:
+
+* local metadata:provider 通过 metadata service 暴露 metadata;
+* remote metadata:provider 将 metadata 上报到 metadata center,consumer 从 metadata center 读取。
+
+默认 metadata type 是 `local`。`metadata-service-protocol` 默认是 `dubbo`,也可以通过 `dubbo.WithMetadataServiceProtocol(...)` 显式设置。
+
+## 治理与 Mesh 集成
+
+Dubbo Go 将许多治理能力放在 SDK 侧扩展点上:
+
+* filter:承载 metrics、tracing、token、泛化调用、优雅停机等横切逻辑;
+* router:支持 condition、tag、script、mesh 风格路由;
+* load balance 和 cluster:负责调用选择和容错策略。
+
+常用内置实现由 `imports` 包统一导入,这些包的 `init` 函数会将扩展注册到 `common/extension`。
diff --git a/content/zh-cn/overview/mannual/golang-sdk/sourcecode/_index.md b/content/zh-cn/overview/mannual/golang-sdk/sourcecode/_index.md
new file mode 100644
index 00000000000..a95b538732b
--- /dev/null
+++ b/content/zh-cn/overview/mannual/golang-sdk/sourcecode/_index.md
@@ -0,0 +1,15 @@
+---
+aliases:
+ - /zh/docs3-v2/golang-sdk/sourcecode/
+ - /zh-cn/docs3-v2/golang-sdk/sourcecode/
+ - /zh-cn/overview/mannual/golang-sdk/sourcecode/
+ - /zh-cn/overview/mannual/golang-sdk/refer/sourcecode/
+description: 当前 Dubbo Go 运行时架构与扩展点源码指南
+title: 源码指南
+type: docs
+weight: 5
+---
+
+本节从源码入口解释当前 Dubbo Go 的运行时:整体架构、protocol、registry 与服务发现、泛化调用、应用/接口配置,以及扩展加载机制。
+
+如果你想先理解端到端调用链,建议从[架构](/zh-cn/overview/mannual/golang-sdk/sourcecode/architecture/)开始;之后再阅读 protocol、registry 和 extension 相关页面。
diff --git a/content/zh-cn/overview/mannual/golang-sdk/sourcecode/aop_and_extension.md b/content/zh-cn/overview/mannual/golang-sdk/sourcecode/aop_and_extension.md
new file mode 100644
index 00000000000..fe3f8903e80
--- /dev/null
+++ b/content/zh-cn/overview/mannual/golang-sdk/sourcecode/aop_and_extension.md
@@ -0,0 +1,115 @@
+---
+aliases:
+ - /zh/docs3-v2/golang-sdk/preface/design/aop_and_extension/
+ - /zh-cn/docs3-v2/golang-sdk/preface/design/aop_and_extension/
+ - /zh-cn/overview/mannual/golang-sdk/preface/design/aop_and_extension/
+ - /zh-cn/overview/mannual/golang-sdk/refer/sourcecode/aop_and_extension/
+description: 当前 Dubbo Go 的 AOP 与扩展机制
+keywords: AOP, extension
+title: AOP 与可扩展机制
+type: docs
+---
+
+相关示例:
+
+* 自定义 filter:<a href="https://github.com/apache/dubbo-go-samples/tree/main/filter/custom" target="_blank">dubbo-go-samples/filter/custom</a>
+* 条件路由:<a href="https://github.com/apache/dubbo-go-samples/tree/main/router/condition" target="_blank">dubbo-go-samples/router/condition</a>
+* 标签路由:<a href="https://github.com/apache/dubbo-go-samples/tree/main/router/tag" target="_blank">dubbo-go-samples/router/tag</a>
+
+Dubbo Go 通过 Go 包初始化和统一的扩展注册中心,来承载大部分可插拔能力。filter、router、protocol、registry、load balance、cluster 策略、tracing exporter、metadata report 等能力,都是按这个模型加载的。
+
+## extension 注册中心
+
+当前实现位于 `common/extension`。它已经不再依赖每个类型单独维护的原始 map,而是统一使用泛型注册中心:
+
+```go
+var loadbalances = NewRegistry[func() loadbalance.LoadBalance]("loadbalance")
+
+func SetLoadbalance(name string, fcn func() loadbalance.LoadBalance) {
+ loadbalances.Register(name, fcn)
+}
+
+func GetLoadbalance(name string) loadbalance.LoadBalance {
+ return loadbalances.MustGet(name)()
+}
+```
+
+同样的模式也用在:
+
+* `common/extension/filter.go`
+* `common/extension/protocol.go`
+* `common/extension/registry.go`
+* `common/extension/router_factory.go`
+
+这样做之后,Dubbo Go 的扩展注册模型更统一,也支持某些类别上的注销、列举已注册名称等辅助能力。
+
+## `init()` 的作用
+
+内置实现通常都会在自己的包里通过 `init()` 完成注册:
+
+```go
+func init() {
+ extension.SetLoadbalance(constant.LoadBalanceKeyRandom, NewRandomLoadBalance)
+}
+```
+
+运行时里很多能力都遵循这个模式:
+
+* `protocol/triple/triple.go` 注册 Triple
+* `protocol/dubbo/dubbo_protocol.go` 注册 Dubbo
+* `protocol/rest/rest_protocol.go` 注册 REST
+* `registry/nacos/registry.go`、`registry/zookeeper/registry.go`、`registry/etcdv3/registry.go` 注册 registry
+* `filter/generic/filter.go`、`filter/metrics/filter.go`、`filter/graceful_shutdown/...` 注册 filter
+* `cluster/router/condition/factory.go`、`cluster/router/tag/factory.go`、`cluster/router/script/factory.go` 注册 router factory
+
+只要这些包被导入,框架后续就能按名称查找到对应实现。
+
+## `imports` 包
+
+对大多数应用来说,最简单的做法是直接导入:
+
+```go
+import _ "dubbo.apache.org/dubbo-go/v3/imports"
+```
+
+`imports/imports.go` 是一个一站式入口,会统一导入常用内置实现,包括:
+
+* cluster 策略
+* load balance
+* router
+* config center
+* filter
+* metadata report 实现
+* tracing 和 metrics exporter
+* protocol
+* registry
+
+如果你希望更精细地控制依赖面,也可以只按需导入具体实现包。
+
+## 自定义扩展
+
+自定义扩展一般遵循下面几步:
+
+1. 实现目标接口;
+2. 在 `init()` 中通过 `common/extension` 注册工厂;
+3. 确保应用最终导入了这个包。
+
+例如:
+
+* 自定义 filter:使用 `extension.SetFilter(...)`
+* 自定义 router factory:使用 `extension.SetRouterFactory(...)`
+* 自定义 protocol:使用 `extension.SetProtocol(...)`
+* 自定义 registry:使用 `extension.SetRegistry(...)`
+
+后续框架就可以根据配置或运行时选项里的名称来解析这些实现。
+
+## 面向切面的调用链
+
+Dubbo Go 在多个核心抽象上采用了 AOP 风格的调用链设计:
+
+* `filter.Filter`
+* `cluster.Router`
+* `cluster/loadbalance.LoadBalance`
+* `protocol/base.Invoker`
+
+每个实现只关注自己的一层职责,然后组合进更大的调用链里。这也是 metrics、tracing、token 校验、泛化调用、优雅停机等能力可以在不侵入所有 protocol 或业务 handler 的前提下接入的原因。
diff --git a/content/zh-cn/overview/mannual/golang-sdk/sourcecode/app_and_interface.md b/content/zh-cn/overview/mannual/golang-sdk/sourcecode/app_and_interface.md
new file mode 100644
index 00000000000..c1a6d1a54f6
--- /dev/null
+++ b/content/zh-cn/overview/mannual/golang-sdk/sourcecode/app_and_interface.md
@@ -0,0 +1,106 @@
+---
+aliases:
+ - /zh/docs3-v2/golang-sdk/preface/design/app_and_interface/
+ - /zh-cn/docs3-v2/golang-sdk/preface/design/app_and_interface/
+ - /zh-cn/overview/mannual/golang-sdk/preface/design/app_and_interface/
+ - /zh-cn/overview/mannual/golang-sdk/refer/sourcecode/app_and_interface/
+description: 当前 Dubbo Go 中的应用级与接口级概念
+keywords: 基本概念
+title: 应用和接口
+type: docs
+---
+
+相关示例:
+
+* Hello world 应用:<a href="https://github.com/apache/dubbo-go-samples/tree/main/helloworld" target="_blank">dubbo-go-samples/helloworld</a>
+* 基于 YAML 的配置:<a href="https://github.com/apache/dubbo-go-samples/tree/main/config_yaml" target="_blank">dubbo-go-samples/config_yaml</a>
+* 基于注册中心的应用:<a href="https://github.com/apache/dubbo-go-samples/tree/main/registry/nacos" target="_blank">dubbo-go-samples/registry/nacos</a>
+
+当前 Dubbo Go 依然保留“应用级配置”和“接口级服务引用”这两个层次,但它的运行时模型已经比早期版本里那种简单的“application vs interface”说明更完整。现在真正的源码入口,是 `options.go` 里的应用实例选项,以及兼容配置文件模式的 `config/root_config.go`。
+
+## 应用级配置
+
+应用级配置会被同一个 Dubbo Go 进程里的所有服务和引用共享。
+
+在配置文件模式下,这套模型由 `config.RootConfig` 表达,主要字段包括:
+
+* `Application`
+* `Protocols`
+* `Registries`
+* `ConfigCenter`
+* `MetadataReport`
+* `Provider`
+* `Consumer`
+* `Otel`
+* `Metrics`
+* `Tracing`
+* `Logger`
+* `Shutdown`
+* `Router`
+* `TLSConfig`
+
+在 API 模式下,对应的是 `options.go` 里的 `InstanceOptions`,它通常通过下面这些 helper 填充:
+
+* `dubbo.WithProtocol(...)`
+* `dubbo.WithRegistry(...)`
+* `dubbo.WithConfigCenter(...)`
+* `dubbo.WithMetadataReport(...)`
+* `dubbo.WithMetrics(...)`
+* `dubbo.WithTracing(...)`
+* `dubbo.WithShutdown(...)`
+* `dubbo.WithRouter(...)`
+* `dubbo.WithRemoteMetadata()`
+* `dubbo.WithMetadataServiceProtocol(...)`
+
+这些选项描述的是整个应用实例的运行环境,而不是某一个单独服务。
+
+## 接口级配置
+
+接口级配置则绑定在单个暴露服务或单个远程引用上。
+
+在 provider 侧,核心单位是注册出来的 service:
+
+* `server.Register(...)`
+* `server.RegisterService(...)`
+* `server.ServiceOptions`
+
+这一层承载接口名、实现 handler、protocol ID、registry ID、序列化方式,以及服务 metadata 等信息。
+
+在 consumer 侧,核心单位是 reference:
+
+* 通过 `client.DialWithInfo(...)` 创建的生成代码 stub
+* 通过 `client.DialWithService(...)` 创建的普通 service reference
+* 通过 `client.NewGenericService(...)` 创建的泛化 reference
+
+这一层承载接口名、直连 URL 或注册中心目标、协议选择、group/version、timeout,以及按引用粒度配置的路由或 metadata 行为。
+
+## 为什么要区分这两个层次
+
+这个区分在当前 Dubbo Go 里尤其重要,因为应用级服务发现已经是常见模式。
+
+应用级负责的内容包括:
+
+* application identity
+* 注册中心和 metadata center 接入
+* protocol server/client 初始化
+* tracing、metrics、logging
+* router 和 shutdown 策略
+
+接口级负责的内容包括:
+
+* 哪个服务被 export 或 refer
+* 哪些方法可以被调用
+* 每个服务绑定哪些 protocol 和 registry
+* 泛化调用或生成代码调用的具体行为
+
+所以,一个进程里可以同时暴露多个服务、引用多个远程服务,同时共享同一套 application identity、registry、protocol server 和治理配置。
+
+## Provider 和 Consumer 可以共存
+
+一个 Dubbo Go 进程可以同时具备 provider 和 consumer 两种角色。实际运行时通常就是这样:
+
+* 一个应用实例里可以有多个 service;
+* 同一个应用实例也可以同时引用多个远程 service;
+* 除非在 service 或 reference 层显式覆盖,否则它们共享同一套顶层实例选项。
+
+这也是为什么你会在源码中看到 `server`、`client`、`registry`、`metadata`、`protocol` 这些包按职责拆开的原因。
diff --git a/content/zh-cn/overview/mannual/golang-sdk/sourcecode/architecture.md b/content/zh-cn/overview/mannual/golang-sdk/sourcecode/architecture.md
new file mode 100644
index 00000000000..5f7e5fd693b
--- /dev/null
+++ b/content/zh-cn/overview/mannual/golang-sdk/sourcecode/architecture.md
@@ -0,0 +1,66 @@
+---
+aliases:
+ - /zh/docs3-v2/golang-sdk/preface/design/architecture/
+ - /zh-cn/docs3-v2/golang-sdk/preface/design/architecture/
+ - /zh-cn/overview/mannual/golang-sdk/preface/design/architecture/
+ - /zh-cn/overview/mannual/golang-sdk/refer/sourcecode/architecture/
+description: 当前 Dubbo Go 架构
+keywords: 架构
+title: 架构
+type: docs
+weight: 1
+---
+
+相关示例:
+
+* 快速开始 RPC 应用:<a href="https://github.com/apache/dubbo-go-samples/tree/main/helloworld" target="_blank">dubbo-go-samples/helloworld</a>
+* 基于注册中心的微服务应用:<a href="https://github.com/apache/dubbo-go-samples/tree/main/registry/nacos" target="_blank">dubbo-go-samples/registry/nacos</a>
+* 多协议应用:<a href="https://github.com/apache/dubbo-go-samples/tree/main/rpc/multi-protocols" target="_blank">dubbo-go-samples/rpc/multi-protocols</a>
+
+Dubbo Go 当前围绕几个运行时概念组织:应用实例、provider、consumer、protocol、registry、metadata 和治理扩展。现在的应用通常通过 `dubbo.go`、`server`、`client` 中的 API 入口构建;使用配置文件的场景仍然会走 `config.RootConfig`。
+
+## 主要运行层次
+
+| 层次 | 主要包 | 职责 |
+| --- | --- | --- |
+| 应用实例 | `dubbo.go`, `options.go` | 持有 application、protocol、registry、metadata、metrics、tracing、router、shutdown 等选项。 |
+| Provider API | `server` | 注册 service handler,构造 service options,创建 invoker 并暴露服务。 |
+| Consumer API | `client` | 创建 client,引用服务,创建生成代码服务或泛化服务,并发起远程调用。 |
+| Protocol | `protocol/base`, `protocol/triple`, `protocol/dubbo`, `protocol/rest` | Provider 侧将 invoker 转为网络服务,consumer 侧将 invoker 转为网络调用。 |
+| Registry 与发现 | `registry`, `registry/protocol`, `registry/servicediscovery`, `registry/directory` | 负责注册、订阅、服务发现和注册中心驱动的调用。 |
+| Metadata | `metadata`, `metadata/report`, `metadata/mapping` | 负责服务定义、service-to-application 映射和 metadata 上报。 |
+| 治理扩展 | `filter`, `cluster`, `cluster/router`, `cluster/loadbalance`, `common/extension` | 提供 filter、router、load balance、cluster 策略和扩展注册。 |
+
+## Provider 流程
+
+当前 server API 下,provider 通常会经历以下流程:
+
+1. `dubbo.NewInstance(...)` 创建应用实例并初始化全局选项。
+2. `ins.NewServer(...)` 基于 application、protocol、registry、provider 选项创建 server。
+3. 生成代码或用户代码调用 `server.Register(...)` 或 `server.RegisterService(...)`。
+4. server 构造 `ServiceOptions`,记录服务 metadata,并创建 invoker。
+5. `ServiceOptions.Export()` 委托协议完成服务暴露。
+6. 如果配置了注册中心,`registry/protocol` 会协调服务 export、注册中心注册和 metadata 上报。
+
+Triple 协议通过 `protocol/triple` 暴露服务。应用级服务发现路径则通过 `registry/servicediscovery` 注册应用实例和 metadata。
+
+## Consumer 流程
+
+consumer 通常会经历以下流程:
+
+1. `dubbo.NewInstance(...)` 创建应用实例。
+2. `ins.NewClient(...)` 创建带有 registry、protocol、consumer、metadata、metrics、tracing、router 等选项的 client。
+3. 生成代码 client 调用 `client.DialWithInfo(...)`,泛化调用使用 `client.NewGenericService(...)`。
+4. client 构造 `ReferenceOptions`,并在需要时初始化 metadata report。
+5. 直连 URL 会直接进入目标 protocol;注册中心 URL 会进入 `registry/protocol`。
+6. registry directory 接收地址变更,并在调用前应用 router、load balance 和 cluster 逻辑。
+
+## 扩展加载
+
+很多实现通过 Go 包初始化注册。导入:
+
+```go
+import _ "dubbo.apache.org/dubbo-go/v3/imports"
+```
+
+会加载常用内置 protocol、registry、filter、router、metadata report、tracing exporter、metrics、load balance 和 cluster 策略。用户也可以只按需导入具体实现包。
diff --git a/content/zh-cn/overview/mannual/golang-sdk/sourcecode/generic-2.md b/content/zh-cn/overview/mannual/golang-sdk/sourcecode/generic-2.md
new file mode 100644
index 00000000000..7baf0d3175d
--- /dev/null
+++ b/content/zh-cn/overview/mannual/golang-sdk/sourcecode/generic-2.md
@@ -0,0 +1,30 @@
+---
+aliases:
+ - /zh/docs3-v2/golang-sdk/tutorial/develop/features/generic-2/
+ - /zh-cn/docs3-v2/golang-sdk/tutorial/develop/features/generic-2/
+ - /zh-cn/overview/mannual/golang-sdk/refer/sourcecode/generic-2/
+description: 泛化调用文档的兼容说明
+title: 泛化调用兼容说明
+type: docs
+weight: 8
+---
+
+相关示例:
+
+* 泛化调用示例:<a href="https://github.com/apache/dubbo-go-samples/tree/main/generic" target="_blank">dubbo-go-samples/generic</a>
+
+这个页面主要保留给旧链接兼容使用。
+
+当前 Dubbo Go 请优先阅读[泛化调用](/zh-cn/overview/mannual/golang-sdk/sourcecode/generic/)。旧示例里使用的:
+
+* `config.NewReferenceConfigBuilder()`
+* `GenericLoad()`
+* `GetRPCService()`
+
+属于早期以配置对象为中心的 API 路径。现在更推荐的运行时入口是:
+
+* `client.NewGenericService(...)`
+* `filter/generic.GenericService.Invoke(...)`
+* `filter/generic.GenericService.InvokeWithType(...)`
+
+如果你要找一个可以直接参考的完整示例,优先看 `dubbo-go-samples/generic`。
diff --git a/content/zh-cn/overview/mannual/golang-sdk/sourcecode/generic.md b/content/zh-cn/overview/mannual/golang-sdk/sourcecode/generic.md
new file mode 100644
index 00000000000..a09096b3575
--- /dev/null
+++ b/content/zh-cn/overview/mannual/golang-sdk/sourcecode/generic.md
@@ -0,0 +1,91 @@
+---
+aliases:
+ - /zh/docs3-v2/golang-sdk/tutorial/develop/features/generic/
+ - /zh-cn/overview/mannual/golang-sdk/refer/sourcecode/generic/
+ - /zh-cn/docs3-v2/golang-sdk/tutorial/develop/features/generic/
+ - /zh-cn/overview/mannual/golang-sdk/tutorial/develop/features/generic/
+description: 当前 Dubbo Go 的泛化调用
+title: 泛化调用
+type: docs
+weight: 7
+---
+
+相关示例:
+
+* 泛化调用示例:<a href="https://github.com/apache/dubbo-go-samples/tree/main/generic" target="_blank">dubbo-go-samples/generic</a>
+* Triple 示例:<a href="https://github.com/apache/dubbo-go-samples/tree/main/rpc/triple" target="_blank">dubbo-go-samples/rpc/triple</a>
+
+当前 Dubbo Go 的泛化调用主要围绕 `client.NewGenericService(...)` 和 `filter/generic.GenericService` 展开。早期基于 `ReferenceConfigBuilder`、`GenericLoad()`、`GetRPCService()` 的示例属于兼容旧 API 的写法,已经不是推荐入口。
+
+## 核心 API
+
+主要运行时入口在 `client/client.go`:
+
+```go
+genericService, err := cli.NewGenericService(
+ "org.apache.dubbo.samples.UserProvider",
+ client.WithProtocolTriple(),
+ client.WithSerialization(constant.Hessian2Serialization),
+ client.WithURL("tri://127.0.0.1:20000"),
+)
+```
+
+`NewGenericService(...)` 默认会做三件事:
+
+* 设置 `NONIDL`
+* 打开 generic invocation
+* 使用 `hessian2` 序列化
+
+它内部会创建 `filter/generic.GenericService`,然后接入 Dubbo Go 正常的 reference 和 invocation 流程。
+
+## GenericService
+
+核心类型如下:
+
+```go
+type GenericService struct {
+ Invoke func(ctx context.Context, methodName string, types []string, args []hessian.Object) (any, error) `dubbo:"$invoke"`
+}
+```
+
+它和 Dubbo 的泛化调用模型保持一致:调用方提供:
+
+* 方法名
+* 参数类型名列表
+* 参数值列表
+
+框架再把这些内容编码成对远端服务的 `$invoke` 请求。
+
+## 强类型结果辅助方法
+
+当前 Dubbo Go 还提供了 `InvokeWithType(...)`:
+
+```go
+var user User
+err := genericService.InvokeWithType(
+ ctx,
+ "getUser",
+ []string{"java.lang.String"},
+ []hessian.Object{"123"},
+ &user,
+)
+```
+
+这个辅助方法会把泛化调用结果反序列化成具体的 Go 返回对象。这样你既可以保留泛化调用的动态传输方式,又不需要手动把返回的 map 结构再转一遍。
+
+## 常见使用场景
+
+泛化调用通常适合这些场景:
+
+* 调用方没有生成代码 stub
+* 调用方希望按接口名和方法名动态发起调用
+* 调用方要和 Java Dubbo 服务通过 generic payload 交互
+* 在迁移或测试阶段需要一个动态 client
+
+如果你想看 Triple + Hessian2 兼容场景,最值得先看的 sample 就是 `generic`。
+
+## 和 Generic Filter 的关系
+
+它并不只是一个 client helper。实现同时也和 `filter/generic` 下的过滤链相关,Dubbo Go 会在那里处理泛化调用的编码、解码以及服务端适配逻辑。
+
+这也是为什么这个能力既属于 client API,也属于框架基于 filter 的扩展机制。
diff --git a/content/zh-cn/overview/mannual/golang-sdk/sourcecode/protocol.md b/content/zh-cn/overview/mannual/golang-sdk/sourcecode/protocol.md
new file mode 100644
index 00000000000..f2fae820374
--- /dev/null
+++ b/content/zh-cn/overview/mannual/golang-sdk/sourcecode/protocol.md
@@ -0,0 +1,106 @@
+---
+aliases:
+ - /zh/docs3-v2/golang-sdk/sourcecode/protocol/
+ - /zh-cn/docs3-v2/golang-sdk/sourcecode/protocol/
+ - /zh-cn/overview/mannual/golang-sdk/refer/sourcecode/protocol/
+description: 当前网络协议源码概览
+title: 网络协议
+type: docs
+weight: 1
+---
+
+相关示例:
+
+* Triple RPC:<a href="https://github.com/apache/dubbo-go-samples/tree/main/rpc/triple" target="_blank">dubbo-go-samples/rpc/triple</a>
+* 多协议服务:<a href="https://github.com/apache/dubbo-go-samples/tree/main/rpc/multi-protocols" target="_blank">dubbo-go-samples/rpc/multi-protocols</a>
+* gRPC 互通:<a href="https://github.com/apache/dubbo-go-samples/tree/main/rpc/grpc" target="_blank">dubbo-go-samples/rpc/grpc</a>
+
+在当前 Dubbo Go 中,protocol 层是 invocation 模型和底层网络协议之间的桥梁。它一方面负责把 provider 暴露成网络服务,另一方面负责把 consumer 侧的引用转换成可调用的远程 invoker。
+
+## 核心协议抽象
+
+当前协议接口定义在 `protocol/base/base_protocol.go`:
+
+```go
+type Protocol interface {
+ Export(invoker Invoker) Exporter
+ Refer(url *common.URL) Invoker
+ Destroy()
+}
+```
+
+它的职责很直接:
+
+* `Export`:把 provider 侧 invoker 暴露成网络服务
+* `Refer`:为目标 URL 创建 consumer 侧 invoker
+* `Destroy`:销毁该协议持有的 invoker 和 exporter
+
+此外还有一个可选能力:
+
+```go
+type RegistryUnregisterer interface {
+ UnregisterRegistries()
+}
+```
+
+它主要用于优雅停机阶段,让协议在完整 teardown 之前,先把已经暴露出去的服务从注册中心摘除。
+
+## Provider 侧流程
+
+在 provider 侧,Dubbo Go 通常会经过下面这条链路:
+
+1. `server.Register(...)` 或 `server.RegisterService(...)` 创建 service metadata 和 invoker。
+2. `ServiceOptions.Export()` 选择 protocol 和 registry 行为。
+3. 具体协议实现调用 `Export(invoker)`。
+4. 暴露后的服务开始监听配置好的网络端点。
+
+不同协议提供不同的传输层和编解码方式,但都会遵循同一个 `Export` 契约。
+
+## Consumer 侧流程
+
+在 consumer 侧:
+
+1. `client.Dial...(...)` 构造 reference。
+2. 解析直连 URL 或注册中心 URL。
+3. 选中的协议实现调用 `Refer(url)`。
+4. 返回的 invoker 成为生成代码 stub 或泛化调用背后的可调用对象。
+
+这也是为什么 protocol 层会同时服务于生成代码调用和基于注册中心的动态引用。
+
+## 内置协议实现
+
+常用内置实现包括:
+
+* `protocol/triple`
+* `protocol/dubbo`
+* `protocol/rest`
+* `protocol/jsonrpc`
+
+其中 Triple 是当前新应用推荐使用的协议,支持 unary、streaming、metadata header/trailer、reflection,以及在线路层和 gRPC 互通。
+
+如果你想看一个应用如何同时暴露多个协议端点,`rpc/multi-protocols` 是很合适的 sample。
+
+## 注册中心协议包装层
+
+Dubbo Go 还提供了位于 `registry/protocol` 的 registry-backed protocol 层。
+
+它会协调:
+
+* 服务 export
+* 服务注册
+* metadata 上报
+* 订阅和 directory 刷新
+
+所以实际运行时,很多 reference 并不是单纯的“protocol 调用”,而是“registry protocol + 具体业务协议”的组合。
+
+## 带过滤链的协议调用
+
+原始 protocol 实现通常还会经过 `protocol/protocolwrapper` 的再次包装,尤其是 filter 链的接入。这样 protocol 调用就成为很多横切能力的集成点,例如:
+
+* tracing
+* metrics
+* token/auth 校验
+* 泛化调用支持
+* 优雅停机
+
+这也是为什么 protocol 包在接口层看起来很小,但在整个运行时调用链里非常关键。
diff --git a/content/zh-cn/overview/mannual/golang-sdk/sourcecode/registry.md b/content/zh-cn/overview/mannual/golang-sdk/sourcecode/registry.md
new file mode 100644
index 00000000000..53519247090
--- /dev/null
+++ b/content/zh-cn/overview/mannual/golang-sdk/sourcecode/registry.md
@@ -0,0 +1,112 @@
+---
+aliases:
+ - /zh/docs3-v2/golang-sdk/sourcecode/registry/
+ - /zh-cn/docs3-v2/golang-sdk/sourcecode/registry/
+ - /zh-cn/overview/mannual/golang-sdk/refer/sourcecode/registry/
+description: 当前注册中心与服务发现源码概览
+title: 注册中心
+type: docs
+weight: 1
+---
+
+相关示例:
+
+* Nacos 注册中心:<a href="https://github.com/apache/dubbo-go-samples/tree/main/registry/nacos" target="_blank">dubbo-go-samples/registry/nacos</a>
+* Zookeeper 注册中心:<a href="https://github.com/apache/dubbo-go-samples/tree/main/registry/zookeeper" target="_blank">dubbo-go-samples/registry/zookeeper</a>
+* 应用级服务发现:<a href="https://github.com/apache/dubbo-go-samples/tree/main/registry/nacos" target="_blank">dubbo-go-samples/registry/nacos</a>
+
+相关文档:
+
+* [应用级服务发现](/zh-cn/overview/mannual/golang-sdk/tutorial/service-discovery/application-level-service-discovery/)
+
+在当前 Dubbo Go 中,registry 层已经不只是“接口级地址注册”这么简单。它同时参与应用级服务发现、metadata 初始化、订阅刷新,以及基于注册中心的协议暴露流程。
+
+## 核心 Registry 接口
+
+主接口定义在 `registry/registry.go`:
+
+```go
+type Registry interface {
+ common.Node
+ Register(url *common.URL) error
+ UnRegister(url *common.URL) error
+ Subscribe(*common.URL, NotifyListener) error
+ UnSubscribe(*common.URL, NotifyListener) error
+ LoadSubscribeInstances(*common.URL, NotifyListener) error
+}
+```
+
+和旧版说明相比,一个明显变化是 `LoadSubscribeInstances(...)` 已经进入接口契约。原因是订阅本身是异步的,Dubbo Go 在正式进入异步通知流之前,可能需要先同步加载一次初始实例列表。
+
+## 当前职责范围
+
+现在 registry 层覆盖了几类紧密相关的职责:
+
+* provider 注册与反注册
+* consumer 订阅与取消订阅
+* 异步更新前的初始实例加载
+* 应用级服务发现
+* 与 registry 绑定的 metadata 上报
+
+从源码目录看,相关主包包括:
+
+* `registry`
+* `registry/protocol`
+* `registry/servicediscovery`
+* `registry/directory`
+
+## 注册模式
+
+当前 Dubbo Go 通过 `registry/options.go` 支持多种注册模型:
+
+* `registry.WithRegisterService()`
+* `registry.WithRegisterInterface()`
+* `registry.WithRegisterServiceAndInterface()`
+
+它们分别对应:
+
+* `service`:注册应用级实例
+* `interface`:注册接口级 provider URL
+* `all`:迁移阶段同时注册两种模型
+
+这也是它和早期文档的一个关键差异。旧文档大多只讲了接口级注册。
+
+## Provider 与 Consumer 流程
+
+从高层看:
+
+1. provider 通过 `server` 和 `protocol` 暴露服务。
+2. 如果开启了 registry 集成,`registry/protocol` 会协调注册和 metadata 上报。
+3. consumer 通过 registry URL 或 registry 配置引用服务。
+4. `registry/directory` 接收地址变更并维护有效 provider 列表。
+5. router、load balance、cluster 在调用时消费这份地址列表。
+
+在应用级服务发现模型下,consumer 还会先解析 service-to-application mapping,再通过 metadata 恢复出具体可调用的端点。
+
+## 内置注册中心与扩展加载
+
+内置实现通过包初始化注册:
+
+* `registry/nacos`
+* `registry/zookeeper`
+* `registry/etcdv3`
+* `registry/polaris`
+* `registry/servicediscovery`
+
+它们通过 `common/extension.SetRegistry(...)` 暴露,常见加载方式是:
+
+```go
+import _ "dubbo.apache.org/dubbo-go/v3/imports"
+```
+
+## Registry 配置形态
+
+在 API 模式下,registry 相关配置通常通过下面这些入口设置:
+
+* 实例级:`dubbo.WithRegistry(...)`
+* 引用级:`client.WithRegistry(...)` 或 `client.WithRegistryIDs(...)`
+* 服务级:`server.WithRegistry(...)` 或 `server.WithRegistryIDs(...)`
+
+在配置文件模式下,registries 则位于 `RootConfig.Registries`。
+
+这也解释了为什么 registry 既是应用级基础设施,又会在单个 service 或 reference 上作为选择器出现。
diff --git a/content/zh-cn/overview/mannual/golang-sdk/tools/_index.md b/content/zh-cn/overview/mannual/golang-sdk/tools/_index.md
new file mode 100644
index 00000000000..3edf6bff195
--- /dev/null
+++ b/content/zh-cn/overview/mannual/golang-sdk/tools/_index.md
@@ -0,0 +1,8 @@
+---
+aliases:
+ - /zh-cn/overview/mannual/golang-sdk/refer/tools/
+description: "Dubbo Go 应用开发过程中使用的脚手架、代码生成和调试工具。"
+title: 工具
+type: docs
+weight: 4
+---
diff --git a/content/zh-cn/overview/mannual/golang-sdk/refer/use_dubbogo_cli.md b/content/zh-cn/overview/mannual/golang-sdk/tools/dubbogo-cli.md
similarity index 88%
rename from content/zh-cn/overview/mannual/golang-sdk/refer/use_dubbogo_cli.md
rename to content/zh-cn/overview/mannual/golang-sdk/tools/dubbogo-cli.md
index 1524b3def6a..38f89d82814 100644
--- a/content/zh-cn/overview/mannual/golang-sdk/refer/use_dubbogo_cli.md
+++ b/content/zh-cn/overview/mannual/golang-sdk/tools/dubbogo-cli.md
@@ -2,25 +2,35 @@
aliases:
- /zh/docs3-v2/golang-sdk/refer/use_dubbogo_cli/
- /zh-cn/docs3-v2/golang-sdk/refer/use_dubbogo_cli/
+ - /zh-cn/overview/mannual/golang-sdk/refer/use_dubbogo_cli/
description: 使用 dubbogo-cli 工具
title: 使用 dubbogo-cli 工具
type: docs
-weight: 3
+weight: 1
---
-{{% alert title="废弃警告" color="warning" %}}
-自 dubbo-go 3.1.0 版本开始,本工具不再适用。本工具已经停止维护,未来将由 dubboctl 代替,请关注社区动态了解 dubboctl 最新进展。
-{{% /alert %}}
## 1. 安装
-dubbogo-cli 是 Apach/dubbo-go 生态的子项目,为开发者提供便利的应用模板创建、工具安装、接口调试等功能,以提高用户的研发效率。
+dubbogo-cli 现在维护在 Apache dubbo-go 主仓库的
+[`tools/dubbogo-cli`](https://github.com/apache/dubbo-go/tree/main/tools/dubbogo-cli) 目录下,用于提供应用模板
+创建、工具安装、接口调试等能力,帮助提升研发效率。
-执行以下指令安装dubbogo-cli 至 $GOPATH/bin
+先安装 `protoc-gen-go`:
```
-go install github.com/dubbogo/dubbogo-cli@latest
+go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
+```
+
+然后从 dubbo-go 仓库安装 `dubbogo-cli`:
+
+```bash
+git clone --depth 1 https://github.com/apache/dubbo-go.git
+cd dubbo-go/tools/dubbogo-cli
+go install .
```
+请确保 `GOBIN` 或 `GOPATH/bin` 已加入 `PATH`,这样才能直接执行 `dubbogo-cli`。
+
## 2. 功能概览
dubbogo-cli 支持以下能力
@@ -47,11 +57,11 @@ dubbogo-cli 支持以下能力
dubbogo-cli install all
```
- 一键安装以下等工具至 $GOPATH/bin
+ 一键安装以下工具到 `$GOPATH/bin`
- protoc-gen-go-triple
- 用于 triple 协议接口编译
+ 用于 Triple 协议接口编译
- imports-formatter
@@ -79,6 +89,11 @@ dubbogo-cli 支持以下能力
- 调试 Triple 协议接口
+{{% alert title="说明" color="primary" %}}
+`dubbogo-cli install all` 用于安装 `protoc-gen-go-triple` 等配套工具;`dubbogo-cli` 本身请按上面的方式从
+`tools/dubbogo-cli` 目录安装。
+{{% /alert %}}
+
## 3. 功能详解
### 3.1 Demo 应用介绍
@@ -238,11 +253,12 @@ image:
grpc_cli 工具是 gRPC 生态用于调试服务的工具,在 server 开启[反射服务](https://github.com/grpc/grpc/blob/master/doc/server-reflection.md)的前提下,可以获取到服务的 proto 文件、服务名、方法名、参数列表,以及发起 gRPC 调用。
-Triple 协议兼容 gRPC 生态,并默认开启 gRPC 反射服务,因此可以直接使用 grpc_cli 调试 triple 服务。
+Triple 协议兼容 gRPC 生态。在使用标准 Dubbo Go SDK Triple provider 配置时,框架会自动注册 reflection
+service,因此可以直接使用 grpc_cli 调试 Triple 服务。
#### 3.3.2 安装grpc_cli
-> 后续将由 dubbogo-cli 安装,目前需要用户手动安装
+> `grpc_cli` 不由 `dubbogo-cli` 安装;在需要调试 gRPC / Triple 服务时请手动安装。
参考[grpc_cli 文档](https://github.com/grpc/grpc/blob/master/doc/command_line_tool.md)
@@ -433,4 +449,4 @@ req:&main.CallUserStruct{ID:"A000", Male:true, SubInfo:main.SubInfo{SubID:"A001"
=======================
```
-可见接收到了来自cli的数据
\ No newline at end of file
+可见接收到了来自cli的数据
diff --git a/content/zh-cn/overview/mannual/golang-sdk/tutorial/deploy2/_index.md b/content/zh-cn/overview/mannual/golang-sdk/tutorial/deployment/_index.md
similarity index 85%
rename from content/zh-cn/overview/mannual/golang-sdk/tutorial/deploy2/_index.md
rename to content/zh-cn/overview/mannual/golang-sdk/tutorial/deployment/_index.md
index dfcdc5c34e9..cee7bc70ac7 100644
--- a/content/zh-cn/overview/mannual/golang-sdk/tutorial/deploy2/_index.md
+++ b/content/zh-cn/overview/mannual/golang-sdk/tutorial/deployment/_index.md
@@ -2,9 +2,9 @@
aliases:
- /zh/docs3-v2/golang-sdk/tutorial/governance/service-mesh/
- /zh-cn/docs3-v2/golang-sdk/tutorial/governance/service-mesh/
+ - /zh-cn/overview/mannual/golang-sdk/tutorial/deploy2/
description: "学习在 Kubernetes、Service Mesh(Kubernetes Service)、虚拟机(Zookeeper、Nacos)等场景部署 dubbo-go 应用。"
title: 部署应用
type: docs
weight: 100
-toc_hide: true
---
diff --git a/content/zh-cn/overview/mannual/golang-sdk/tutorial/deploy2/deploy.md b/content/zh-cn/overview/mannual/golang-sdk/tutorial/deployment/deploy.md
similarity index 94%
rename from content/zh-cn/overview/mannual/golang-sdk/tutorial/deploy2/deploy.md
rename to content/zh-cn/overview/mannual/golang-sdk/tutorial/deployment/deploy.md
index 2e61d43a2c7..28d06fe8b6b 100644
--- a/content/zh-cn/overview/mannual/golang-sdk/tutorial/deploy2/deploy.md
+++ b/content/zh-cn/overview/mannual/golang-sdk/tutorial/deployment/deploy.md
@@ -2,6 +2,7 @@
aliases:
- /zh/docs3-v2/golang-sdk/tutorial/governance/service-mesh/deploy/
- /zh-cn/docs3-v2/golang-sdk/tutorial/governance/service-mesh/deploy/
+ - /zh-cn/overview/mannual/golang-sdk/tutorial/deploy2/deploy/
description: Istio 环境部署 Dubbo-go 应用
title: Istio 环境部署 Dubbo-go 应用
type: docs
@@ -10,9 +11,13 @@ weight: 2
在本章节中,我们将使用应用模板快速创建一组 Dubbo-go Server和 Client 端应用,部署在 Istio 集群中;观察、调试和验证服务发现和调用成功。
+对应的 mesh 示例见
+<a href="https://github.com/apache/dubbo-go-samples/tree/main/mesh" target="_blank">dubbo-go-samples/mesh</a>。
+
## 1. 准备工作
-- dubbo-go cli 工具和依赖工具已安装、grpc_cli (如需本地调试)。
+- 已安装 `dubbogo-cli` 及相关依赖工具。`dubbogo-cli` 请从 dubbo-go 主仓库
+ [`tools/dubbogo-cli`](../../../tools/dubbogo-cli/) 安装;`grpc_cli` 仅在本地调试时需要。
- docker、helm、kubectl 环境已安装。(arm 机器需支持 docker buildx)
- [任务【istio 环境部署】](../istio/) 已完成
@@ -58,6 +63,8 @@ $ tree .
└── service.go
```
+`dubbogo-cli` 现在维护在 dubbo-go 主仓库的 `tools/dubbogo-cli` 目录下,本文后续步骤都基于它生成的模板展开。
+
生成项目包括几个目录:
- api:放置接口文件:proto文件和生成的pb.go文件
@@ -101,7 +108,7 @@ $ tree .
- 拉取依赖
```bash
- $ go get dubbo.apache.org/dubbo-go/v3@3.0
+ $ go get dubbo.apache.org/dubbo-go/v3@v3.3.1
$ make tidy
go mod tidy
```
@@ -427,4 +434,4 @@ $ kubectl get pods | grep client | awk '{print $1}' | xargs kubectl logs
dubbogo-cli 提供的应用模板可以方便地支持开发者进行镜像的构建、推送、部署。
-在 Istio 环境中,server 应用将自身服务信息注册在 Isito 上,由客户端监听 xds 资源,查询 istio debug 端口进行接口级别的服务发现。开发人员无需关心 service名、主机名、集群名等概念,只需要引入接口,发起调用即可。
\ No newline at end of file
+在 Istio 环境中,server 应用将自身服务信息注册在 Istio 上,由客户端监听 xds 资源,查询 istio debug 端口进行接口级别的服务发现。开发人员无需关心 service名、主机名、集群名等概念,只需要引入接口,发起调用即可。
diff --git a/content/zh-cn/overview/mannual/golang-sdk/tutorial/deploy2/graceful_shutdown.md b/content/zh-cn/overview/mannual/golang-sdk/tutorial/deployment/graceful_shutdown.md
similarity index 93%
rename from content/zh-cn/overview/mannual/golang-sdk/tutorial/deploy2/graceful_shutdown.md
rename to content/zh-cn/overview/mannual/golang-sdk/tutorial/deployment/graceful_shutdown.md
index 40fca749bbf..aa603e4f385 100644
--- a/content/zh-cn/overview/mannual/golang-sdk/tutorial/deploy2/graceful_shutdown.md
+++ b/content/zh-cn/overview/mannual/golang-sdk/tutorial/deployment/graceful_shutdown.md
@@ -2,6 +2,7 @@
aliases:
- /zh/docs3-v2/golang-sdk/tutorial/governance/traffic/graceful_shutdown/
- /zh-cn/docs3-v2/golang-sdk/tutorial/governance/traffic/graceful_shutdown/
+ - /zh-cn/overview/mannual/golang-sdk/tutorial/deploy2/graceful_shutdown/
description: 本文主要介绍优雅下线的基本步骤和使用说明
keywords: 优雅下线
title: 优雅下线
@@ -10,6 +11,8 @@ type: docs
# 优雅下线
+示例源码:<a href="https://github.com/apache/dubbo-go-samples/tree/main/graceful_shutdown" target="_blank">dubbo-go-samples/graceful_shutdown</a>。
+
## 背景
在稳定生产的过程中,容器调度完全由 k8s 管控,微服务治理完全由服务框架或者运维人员进行维护和管理。而在发布新版本,或者扩缩容的场景下,会终止旧的容器实例,并使用新的容器实例进行替换,对于承载高流量的线上生产环境,这个替换过程的衔接如果不合理,将在短时间内造成大量的错误请求,触发报警甚至影响正常业务。对于体量较大的厂家,发布过程出现问题所造成的损失会是巨大的。
@@ -63,4 +66,4 @@ extension.AddCustomShutdownCallback(func() {
## 参考资料
-[【Dubbo-go 优雅上下线的设计与实践】](https://developer.aliyun.com/article/860775)
\ No newline at end of file
+[【Dubbo-go 优雅上下线的设计与实践】](https://developer.aliyun.com/article/860775)
diff --git a/content/zh-cn/overview/mannual/golang-sdk/tutorial/deploy2/istio.md b/content/zh-cn/overview/mannual/golang-sdk/tutorial/deployment/istio.md
similarity index 71%
rename from content/zh-cn/overview/mannual/golang-sdk/tutorial/deploy2/istio.md
rename to content/zh-cn/overview/mannual/golang-sdk/tutorial/deployment/istio.md
index 5e7782f83ed..6e9b14db1b1 100644
--- a/content/zh-cn/overview/mannual/golang-sdk/tutorial/deploy2/istio.md
+++ b/content/zh-cn/overview/mannual/golang-sdk/tutorial/deployment/istio.md
@@ -2,21 +2,20 @@
aliases:
- /zh/docs3-v2/golang-sdk/tutorial/governance/service-mesh/istio/
- /zh-cn/docs3-v2/golang-sdk/tutorial/governance/service-mesh/istio/
+ - /zh-cn/overview/mannual/golang-sdk/tutorial/deploy2/istio/
description: 部署 Istio 环境
title: 部署 Istio 环境
type: docs
weight: 1
---
-
-
-
-
+相关示例:<a href="https://github.com/apache/dubbo-go-samples/tree/main/mesh" target="_blank">dubbo-go-samples/mesh</a>。
## 1. 准备工作
- docker、helm、kubectl 环境已安装。
-- dubbo-go cli 工具和依赖工具已安装
+- 已安装 `dubbogo-cli` 及相关依赖工具。`dubbogo-cli` 请从 dubbo-go 主仓库
+ [`tools/dubbogo-cli`](../../../tools/dubbogo-cli/) 安装。
## 2. 部署 Istio 环境
@@ -37,4 +36,4 @@ $ helm install istiod istio/istiod --namespace istio-system
$ kubectl delete hpa istiod -n istio-system
```
-安装完成后,可以在 istio-system 命名空间下看到一个 istiod pod 在正常运行。
\ No newline at end of file
+安装完成后,可以在 istio-system 命名空间下看到一个 istiod pod 在正常运行。
diff --git a/content/zh-cn/overview/mannual/golang-sdk/tutorial/deploy2/proxyless_service_mesh.md b/content/zh-cn/overview/mannual/golang-sdk/tutorial/deployment/proxyless_service_mesh.md
similarity index 93%
rename from content/zh-cn/overview/mannual/golang-sdk/tutorial/deploy2/proxyless_service_mesh.md
rename to content/zh-cn/overview/mannual/golang-sdk/tutorial/deployment/proxyless_service_mesh.md
index 9ee8ff7bf1d..be1ae757ab8 100644
--- a/content/zh-cn/overview/mannual/golang-sdk/tutorial/deploy2/proxyless_service_mesh.md
+++ b/content/zh-cn/overview/mannual/golang-sdk/tutorial/deployment/proxyless_service_mesh.md
@@ -2,16 +2,14 @@
aliases:
- /zh/docs3-v2/golang-sdk/tutorial/governance/service-mesh/proxyless_service_mesh/
- /zh-cn/docs3-v2/golang-sdk/tutorial/governance/service-mesh/proxyless_service_mesh/
+ - /zh-cn/overview/mannual/golang-sdk/tutorial/deploy2/proxyless_service_mesh/
description: 无代理服务网格
keywords: 无代理服务网格
title: 无代理服务网格
type: docs
---
-
-
-
-
+示例源码:<a href="https://github.com/apache/dubbo-go-samples/tree/main/mesh" target="_blank">dubbo-go-samples/mesh</a>。
## 1. 什么是 Proxyless Service-Mesh (无代理服务网格) ?
@@ -82,9 +80,10 @@ Dubbo-go 拥有路由能力,通过 xds 协议客户端从 istiod 订阅路由
#### 云原生脚手架
-dubbogo-cli 是 Apache/dubbo-go 生态的子项目,为开发者提供便利的应用模板创建、工具安装、接口调试等功能,以提高用户的研发效率。
+dubbogo-cli 现在维护在 Apache dubbo-go 主仓库的 `tools/dubbogo-cli` 目录下,为开发者提供应用模板创建、
+工具安装、接口调试等能力,以提高研发效率。
-详情可以参阅 [【dubbogo-cli 工具】](/zh-cn/overview/mannual/golang-sdk/refer/use_dubbogo_cli/)
+详情可以参阅 [【dubbogo-cli 工具】](/zh-cn/overview/mannual/golang-sdk/tools/dubbogo-cli/)
## 3. Dubbo-go-Mesh 的优势
@@ -113,4 +112,4 @@ Dubbo-go 是一个横跨多个生态的服务框架。
- 多语言优势,可以实现 go-java 应用互通。
- 兼容 pixiu 网关,方便地进行服务的暴露和协议转换。
- - 使用 Dubbo-go 生态组件。
\ No newline at end of file
+ - 使用 Dubbo-go 生态组件。
diff --git a/content/zh-cn/overview/mannual/golang-sdk/tutorial/deploy2/traffic_management.md b/content/zh-cn/overview/mannual/golang-sdk/tutorial/deployment/traffic_management.md
similarity index 96%
rename from content/zh-cn/overview/mannual/golang-sdk/tutorial/deploy2/traffic_management.md
rename to content/zh-cn/overview/mannual/golang-sdk/tutorial/deployment/traffic_management.md
index 2340b4f02c7..6eec4fe05e7 100644
--- a/content/zh-cn/overview/mannual/golang-sdk/tutorial/deploy2/traffic_management.md
+++ b/content/zh-cn/overview/mannual/golang-sdk/tutorial/deployment/traffic_management.md
@@ -2,24 +2,24 @@
aliases:
- /zh/docs3-v2/golang-sdk/tutorial/governance/service-mesh/traffic_management/
- /zh-cn/docs3-v2/golang-sdk/tutorial/governance/service-mesh/traffic_management/
+ - /zh-cn/overview/mannual/golang-sdk/tutorial/deploy2/traffic_management/
description: 流量管理
title: 流量管理
type: docs
weight: 3
---
-
-
-
-
-
在本节中,我们将延续上一个任务[【在 Istio 环境部署 Dubbo-go 应用】](../deploy/)。
在之前的任务中,我们在集群中部署了一组 Dubbo-go Server和 Client 端应用,验证了服务发现和调用成功。在本节中,我们将创建新版本的 Server 端应用。通过配置 VirtualService 和 DestinationRule ,实现路由管理,和流量转移能力
+对应的流量治理部署清单见
+<a href="https://github.com/apache/dubbo-go-samples/tree/main/mesh/deploy/traffic" target="_blank">dubbo-go-samples/mesh/deploy/traffic</a>。
+
## 1. 准备工作
-- dubbo-go cli 工具和依赖工具已安装、grpc_cli (如需本地调试)。
+- 已安装 `dubbogo-cli` 及相关依赖工具。`dubbogo-cli` 请从 dubbo-go 主仓库
+ [`tools/dubbogo-cli`](../../../tools/dubbogo-cli/) 安装;`grpc_cli` 仅在本地调试时需要。
- docker、helm、kubectl 环境已安装。(arm 机器需支持 docker buildx)
- 任务[【在 Istio 环境部署 Dubbo-go 应用】](../deploy/)已完成
@@ -422,4 +422,4 @@ $ kubectl get pods | grep client | awk '{print $1}' | xargs kubectl logs
2022-04-07T05:56:01.050Z INFO cmd/app.go:35 call server response = name:"Hello laurence" id:"v2.0.0"
2022-04-07T05:56:02.053Z INFO cmd/app.go:35 call server response = name:"Hello laurence" id:"v1.0.0"
2022-04-07T05:56:03.055Z INFO cmd/app.go:35 call server response = name:"Hello laurence" id:"v1.0.0"
-```
\ No newline at end of file
+```
diff --git a/content/zh-cn/overview/mannual/golang-sdk/tutorial/interoperability/_index.md b/content/zh-cn/overview/mannual/golang-sdk/tutorial/interoperability/_index.md
new file mode 100644
index 00000000000..7137c5745af
--- /dev/null
+++ b/content/zh-cn/overview/mannual/golang-sdk/tutorial/interoperability/_index.md
@@ -0,0 +1,6 @@
+---
+description: "与 Dubbo Java、gRPC 等 RPC 生态互通。"
+title: 互操作
+type: docs
+weight: 90
+---
diff --git a/content/zh-cn/overview/mannual/golang-sdk/tutorial/interop-dubbo/_index.md b/content/zh-cn/overview/mannual/golang-sdk/tutorial/interoperability/dubbo-java/_index.md
similarity index 81%
rename from content/zh-cn/overview/mannual/golang-sdk/tutorial/interop-dubbo/_index.md
rename to content/zh-cn/overview/mannual/golang-sdk/tutorial/interoperability/dubbo-java/_index.md
index cb383816a58..ee9650347ff 100755
--- a/content/zh-cn/overview/mannual/golang-sdk/tutorial/interop-dubbo/_index.md
+++ b/content/zh-cn/overview/mannual/golang-sdk/tutorial/interoperability/dubbo-java/_index.md
@@ -3,8 +3,9 @@ aliases:
- /zh/docs3-v2/golang-sdk/tutorial/debugging/
- /zh-cn/docs3-v2/golang-sdk/tutorial/debugging/
- /zh-cn/overview/mannual/golang-sdk/tutorial/develop/interflow/call_java/
+ - /zh-cn/overview/mannual/golang-sdk/tutorial/interop-dubbo/
description: "实现 dubbo go 和 dubbo java 应用互通,包括服务发现、协议通信等。"
title: 与dubbo-java互通
type: docs
-weight: 90
+weight: 1
---
diff --git a/content/zh-cn/overview/mannual/golang-sdk/tutorial/interop-dubbo/call_java_protocol_dubbo_non_protobuf.md b/content/zh-cn/overview/mannual/golang-sdk/tutorial/interoperability/dubbo-java/call_java_protocol_dubbo_non_protobuf.md
similarity index 96%
rename from content/zh-cn/overview/mannual/golang-sdk/tutorial/interop-dubbo/call_java_protocol_dubbo_non_protobuf.md
rename to content/zh-cn/overview/mannual/golang-sdk/tutorial/interoperability/dubbo-java/call_java_protocol_dubbo_non_protobuf.md
index d181013f460..a19b8f2c105 100644
--- a/content/zh-cn/overview/mannual/golang-sdk/tutorial/interop-dubbo/call_java_protocol_dubbo_non_protobuf.md
+++ b/content/zh-cn/overview/mannual/golang-sdk/tutorial/interoperability/dubbo-java/call_java_protocol_dubbo_non_protobuf.md
@@ -2,6 +2,7 @@
aliases:
- /zh/docs3-v2/golang-sdk/tutorial/develop/interflow/call_java/
- /zh-cn/docs3-v2/golang-sdk/tutorial/develop/interflow/call_java/
+ - /zh-cn/overview/mannual/golang-sdk/tutorial/interop-dubbo/call_java_protocol_dubbo_non_protobuf/
description: "如果您是 dubbo java 的老用户,可能您的 dubbo java 应用并没有使用 protobuf(直接使用 java interface 定义服务),这个时候您需要使用以下方式开发 dubbo go-client,来调用老版本的 dubbo 服务。"
title: 非protoubf模式协议互通(适用于老版本 dubbo java 应用)
linkTitle: 非protoubf模式协议互通
diff --git a/content/zh-cn/overview/mannual/golang-sdk/tutorial/interop-dubbo/call_java_protocol_triple_protobuf.md b/content/zh-cn/overview/mannual/golang-sdk/tutorial/interoperability/dubbo-java/call_java_protocol_triple_protobuf.md
similarity index 96%
rename from content/zh-cn/overview/mannual/golang-sdk/tutorial/interop-dubbo/call_java_protocol_triple_protobuf.md
rename to content/zh-cn/overview/mannual/golang-sdk/tutorial/interoperability/dubbo-java/call_java_protocol_triple_protobuf.md
index f3d7e1fa350..b3e894268a9 100644
--- a/content/zh-cn/overview/mannual/golang-sdk/tutorial/interop-dubbo/call_java_protocol_triple_protobuf.md
+++ b/content/zh-cn/overview/mannual/golang-sdk/tutorial/interoperability/dubbo-java/call_java_protocol_triple_protobuf.md
@@ -2,6 +2,7 @@
aliases:
- /zh/docs3-v2/golang-sdk/tutorial/develop/interflow/call_java/
- /zh-cn/docs3-v2/golang-sdk/tutorial/develop/interflow/call_java/
+ - /zh-cn/overview/mannual/golang-sdk/tutorial/interop-dubbo/call_java_protocol_triple_protobuf/
description: “基于 protobuf 实现 dubbo-java 与 dubbo-go 的 triple 协议互通。”
title: 基于 protobuf 实现 triple 协议互通(适用于两边都用 protobuf 开发的场景)
linkTitle: protobuf+triple 协议互通
diff --git a/content/zh-cn/overview/mannual/golang-sdk/tutorial/interop-dubbo/service-discovery.md b/content/zh-cn/overview/mannual/golang-sdk/tutorial/interoperability/dubbo-java/service-discovery.md
similarity index 95%
rename from content/zh-cn/overview/mannual/golang-sdk/tutorial/interop-dubbo/service-discovery.md
rename to content/zh-cn/overview/mannual/golang-sdk/tutorial/interoperability/dubbo-java/service-discovery.md
index 183169109f9..5345c072eb9 100644
--- a/content/zh-cn/overview/mannual/golang-sdk/tutorial/interop-dubbo/service-discovery.md
+++ b/content/zh-cn/overview/mannual/golang-sdk/tutorial/interoperability/dubbo-java/service-discovery.md
@@ -1,4 +1,6 @@
---
+aliases:
+ - /zh-cn/overview/mannual/golang-sdk/tutorial/interop-dubbo/service-discovery/
description: "dubbo-java 和 dubbo-go 使用相同的服务发现模型,本文档演示如何基于应用级服务发现实现地址互通。"
title: 基于应用级服务发现实现地址互通
linkTitle: 服务发现实现地址互通
diff --git a/content/zh-cn/overview/mannual/golang-sdk/tutorial/interop-grpc/_index.md b/content/zh-cn/overview/mannual/golang-sdk/tutorial/interoperability/grpc/_index.md
similarity index 80%
rename from content/zh-cn/overview/mannual/golang-sdk/tutorial/interop-grpc/_index.md
rename to content/zh-cn/overview/mannual/golang-sdk/tutorial/interoperability/grpc/_index.md
index e6033853588..8dab0d501f8 100755
--- a/content/zh-cn/overview/mannual/golang-sdk/tutorial/interop-grpc/_index.md
+++ b/content/zh-cn/overview/mannual/golang-sdk/tutorial/interoperability/grpc/_index.md
@@ -3,8 +3,9 @@ aliases:
- /zh/docs3-v2/golang-sdk/tutorial/debugging/
- /zh-cn/docs3-v2/golang-sdk/tutorial/debugging/
- /zh-cn/overview/mannual/golang-sdk/tutorial/debugging/grpc_cli/
+ - /zh-cn/overview/mannual/golang-sdk/tutorial/interop-grpc/
description: "实现 dubbo go 与谷歌官方版本 grpc 框架互通。"
title: 与grpc互通
type: docs
-weight: 100
+weight: 2
---
diff --git a/content/zh-cn/overview/mannual/golang-sdk/tutorial/interop-grpc/call_grpc.md b/content/zh-cn/overview/mannual/golang-sdk/tutorial/interoperability/grpc/call_grpc.md
similarity index 98%
rename from content/zh-cn/overview/mannual/golang-sdk/tutorial/interop-grpc/call_grpc.md
rename to content/zh-cn/overview/mannual/golang-sdk/tutorial/interoperability/grpc/call_grpc.md
index 1fcee98563f..fb38f44b080 100644
--- a/content/zh-cn/overview/mannual/golang-sdk/tutorial/interop-grpc/call_grpc.md
+++ b/content/zh-cn/overview/mannual/golang-sdk/tutorial/interoperability/grpc/call_grpc.md
@@ -2,6 +2,7 @@
aliases:
- /zh/docs3-v2/golang-sdk/tutorial/develop/interflow/call_grpc/
- /zh-cn/docs3-v2/golang-sdk/tutorial/develop/interflow/call_grpc/
+ - /zh-cn/overview/mannual/golang-sdk/tutorial/interop-grpc/call_grpc/
description: 与 gRPC 应用互通
title: 与 gRPC 应用互通
type: docs
diff --git a/content/zh-cn/overview/mannual/golang-sdk/tutorial/observability/probe.md b/content/zh-cn/overview/mannual/golang-sdk/tutorial/observability/probe.md
index e4b02567adb..9a21692276e 100644
--- a/content/zh-cn/overview/mannual/golang-sdk/tutorial/observability/probe.md
+++ b/content/zh-cn/overview/mannual/golang-sdk/tutorial/observability/probe.md
@@ -23,7 +23,7 @@ Dubbo-Go 提供内置的 **Kubernetes HTTP Probe 服务**,用于支持:
* 可选内部生命周期对齐
* 可控的重启风险
-以下是一个具体的使用示例,可查看 [示例完整源码](https://github.com/apache/dubbo-go-samples/tree/main/metrics)。
+以下是一个具体的使用示例,可查看 [示例完整源码](https://github.com/apache/dubbo-go-samples/tree/main/metrics/probe)。
---
diff --git a/content/zh-cn/overview/mannual/golang-sdk/tutorial/observability/tracing.md b/content/zh-cn/overview/mannual/golang-sdk/tutorial/observability/tracing.md
index 526a55cab99..8823648cc30 100644
--- a/content/zh-cn/overview/mannual/golang-sdk/tutorial/observability/tracing.md
+++ b/content/zh-cn/overview/mannual/golang-sdk/tutorial/observability/tracing.md
@@ -19,7 +19,7 @@ Dubbo-go 支持基于 [OpenTelemetry](https://opentelemetry.io/) 标准的全链
请注意,仅支持通过 `dubbo.NewInstance` 方式创建 dubbo 应用时开启 tracing 功能,也就是我们快速开始中提到的`微服务应用模式`,对于`轻量 RPC API`暂时不支持开启 tracing。
## 示例详解
-可在此查看完整示例[源码](https://github.com/apache/dubbo-go-samples/tree/main/otel)地址。
+可在此查看[完整示例源码](https://github.com/apache/dubbo-go-samples/tree/main/otel/tracing)。
使用 `dubbo.WithTracing()` 开启 tracing,可以通过多个参数控制 tracing 行为:
@@ -82,4 +82,3 @@ sample-ratio: 0.5
- sample-ratio: sample ratio, only used when sample-mode is ratio, range between 0 and 1
- `trace.WithRatio(float64)`
-
diff --git a/content/zh-cn/overview/mannual/golang-sdk/tutorial/rpc/attachments.md b/content/zh-cn/overview/mannual/golang-sdk/tutorial/rpc/attachments.md
index 30fd431ce45..cb258dea48a 100644
--- a/content/zh-cn/overview/mannual/golang-sdk/tutorial/rpc/attachments.md
+++ b/content/zh-cn/overview/mannual/golang-sdk/tutorial/rpc/attachments.md
@@ -5,41 +5,111 @@ type: docs
weight: 4
---
-**理解隐式参数传递的最直接方式 http header,它的工作方式与 http header 完全一致,在 GET 或 POST 请求体之外可以传递任意多个 header 参数**。而对于 RPC 调用而言,context就是在方法签名的参数之外提供附加参数传递能力,在实现原理上,对于不同的协议,attachment 的实现方式略有不同:
-* 对于 triple 协议,attachment 会转换为标准的 http header 进行传输。
-* 对于 dubbo 协议,attachment 是编码在协议体的固定位置进行传输,具体请参见 dubbo 协议规范。、
-
-
+Dubbo-go 提供了两种在 RPC 请求和响应 body 之外传递 metadata 的方式:
+
+* **Attachment** 是 Dubbo RPC 的隐式参数,存放在 `context` 的 `constant.AttachmentKey` 下,常用于 filter、路由、链路追踪或业务代码传递请求级 key-value 数据。对于 Triple 调用,请求 attachment 会以 HTTP metadata header 的形式传输;对于 Dubbo 协议,attachment 会编码在协议体的固定位置。
+* **Triple metadata header 和 trailer** 是 Triple 协议直接暴露给应用层的 metadata API,以 `http.Header` 的形式读写,适合应用代码直接处理请求 metadata 或响应 header/trailer。
+
+示例源码:
+
+* Attachment 示例:<a href="https://github.com/apache/dubbo-go-samples/tree/main/context" target="_blank">dubbo-go-samples/context</a>
+* Triple header/trailer 示例:<a href="https://github.com/apache/dubbo-go-samples/tree/main/triple_header_trailer" target="_blank">dubbo-go-samples/triple_header_trailer</a>
+
+Attachment 传递流程:
+
+```text
+┌───── Consumer side ──────────┐
+│ │
+│ ┌──────────────────────┐ │
+│ │ context.Context │ │
+│ │ AttachmentKey │ │
+│ │ map[string]any │ │
+│ └──────────┬───────────┘ │
+│ │ │
+│ ▼ │
+│ ┌──────────────────────┐ │
+│ │ RPCInvocation │ │
+│ │ Attachments() │ │
+│ └──────────┬───────────┘ │
+│ │ │
+└─────────────┼────────────────┘
+ │
+ ▼
+ ┌────────────────┐
+ │ Protocol │
+ │ metadata │
+ │ │
+ │ Triple: header │
+ │ Dubbo : body │
+ └───────┬────────┘
+ │
+ │ network
+ ▼
+┌──────────────┼─── Provider side ────┐
+│ ▼ │
+│ ┌────────────────┐ │
+│ │ Protocol │ │
+│ │ metadata │ │
+│ └───────┬────────┘ │
+│ │ │
+│ ▼ │
+│ ┌──────────────────────┐ │
+│ │ RPCInvocation │ │
+│ │ Attachments() │ │
+│ └──────────┬───────────┘ │
+│ │ │
+│ ▼ │
+│ ┌──────────────────────┐ │
+│ │ context.Context │ │
+│ │ AttachmentKey │ │
+│ │ map[string]any │ │
+│ └──────────┬───────────┘ │
+│ │ │
+│ ▼ │
+│ ┌──────────────────────┐ │
+│ │ Filter / Service │ │
+│ │ implementation │ │
+│ └──────────────────────┘ │
+│ │
+└─────────────────────────────────────┘
+```
{{% alert title="注意" color="primary" %}}
-* 在使用 triple 协议时,由于 http header 的限制,仅支持小写的 ascii 字符
-* path, group, version, dubbo, token, timeout 等一些 key 是保留字段,传递 attachment 时应避免使用,尽量通过业务前缀等确保 key 的唯一性。
+* 对于 Triple 调用,attachment key 会归一化为小写 HTTP metadata key。传递 attachment 时建议使用小写 ASCII 业务 key。
+* Triple attachment 的 value 建议使用 `string` 或 `[]string`。
+* Triple metadata key 语义上大小写不敏感。读取 header 或 trailer 时,可以按标准 `http.Header` 方式使用 `Get` 和 `Values`。
+* path, group, version, dubbo, token, timeout 等 key 是保留字段。自定义 key 可以通过业务前缀保持唯一性。
{{% /alert %}}
## 1.介绍
-本文档演示如何在 Dubbo-go 框架中使用 context 上下文传递和读取附加参数,来实现上下文信息传递,可在此查看 <a href="https://github.com/apache/dubbo-go-samples/tree/main/context" target="_blank">完整示例源码地址</a>
+本文档先介绍如何通过 `context` 传递请求 attachment,然后介绍如何使用 Triple 请求 metadata、响应 header 和响应 trailer。
-## 2.使用说明
+## 2.Attachment 使用说明
### 2.1客户端使用说明
-在客户端中,使用下述方式传递字段, 示例中 key 为 `constant.AttachmentKey` 即 "attachment":
+在客户端中,可以通过 `constant.AttachmentKey` 传递字段,即 `"attachment"`:
```go
- ctx := context.Background()
- ctx = context.WithValue(ctx, constant.AttachmentKey, map[string]interface{}{
- "key1": "user defined value 1",
- "key2": "user defined value 2"
- })
+ctx := context.Background()
+ctx = context.WithValue(ctx, constant.AttachmentKey, map[string]interface{}{
+ "key1": "user defined value 1",
+ "key2": "user defined value 2",
+})
```
### 2.2服务端使用说明
-在服务端中,使用下述方式获取字段, value的类型为 map[string]interface{}:
+在服务端中,可以从 `constant.AttachmentKey` 读取字段。对于 Triple 请求,header value 会以 `[]string` 的形式保存:
+
```go
- attachments := ctx.Value(constant.AttachmentKey).(map[string]interface{})
+attachments := ctx.Value(constant.AttachmentKey).(map[string]interface{})
+if value1, ok := attachments["key1"]; ok {
logger.Infof("Dubbo attachment key1 = %s", value1.([]string)[0])
+}
+if value2, ok := attachments["key2"]; ok {
logger.Infof("Dubbo attachment key2 = %s", value2.([]string)[0])
+}
```
## 3.示例详解
@@ -179,3 +249,117 @@ func main() {
2024-02-26 11:13:14 INFO logger/logging.go:42 Dubbo attachment key1 = [user defined value 1]
2024-02-26 11:13:14 INFO logger/logging.go:42 Dubbo attachment key2 = [user defined value 2]
```
+
+## 4. Triple Header 和 Trailer
+
+对于 Triple 调用,Dubbo-go 也会通过 `http.Header` 向应用层暴露请求和响应 metadata。metadata key 语义上大小写不敏感,应用代码可以按标准 `http.Header` 方式使用 `Get` 和 `Values` 读取。
+
+### 4.1 请求 Metadata
+
+客户端可以在发起调用前写入请求 metadata:
+
+```go
+import (
+ "context"
+ "net/http"
+
+ triple "dubbo.apache.org/dubbo-go/v3/protocol/triple/triple_protocol"
+)
+
+ctx := triple.NewOutgoingContext(context.Background(), http.Header{
+ "X-Sample-Token": []string{"token"},
+})
+ctx = triple.AppendToOutgoingContext(ctx, "X-Sample-Mode", "metadata")
+
+resp, err := svc.Greet(ctx, &greet.GreetRequest{Name: "hello"})
+```
+
+服务端可以从请求 context 中读取这些 metadata:
+
+```go
+headers, ok := triple.FromIncomingContext(ctx)
+if ok {
+ token := headers.Get("X-Sample-Token")
+ mode := headers.Get("X-Sample-Mode")
+ _ = token
+ _ = mode
+}
+```
+
+生成的流式接口也可以通过 stream 对象读取请求 metadata:
+
+```go
+token := stream.RequestHeader().Get("X-Sample-Token")
+```
+
+### 4.2 Unary 响应 Header 和 Trailer
+
+对于生成的 Unary 调用,服务端可以通过 `triple.SetHeader` 和 `triple.SetTrailer` 写入响应 metadata:
+
+```go
+func (srv *GreetTripleServer) Greet(ctx context.Context, req *greet.GreetRequest) (*greet.GreetResponse, error) {
+ if err := triple.SetHeader(ctx, http.Header{
+ "X-Response-Token": []string{"value"},
+ }); err != nil {
+ return nil, err
+ }
+ if err := triple.SetTrailer(ctx, http.Header{
+ "X-Response-Trailer": []string{"done"},
+ }); err != nil {
+ return nil, err
+ }
+ return &greet.GreetResponse{Greeting: req.Name}, nil
+}
+```
+
+客户端可以通过 call option 捕获本次调用的响应 header 和 trailer:
+
+```go
+var responseHeader http.Header
+var responseTrailer http.Header
+
+resp, err := svc.Greet(
+ ctx,
+ &greet.GreetRequest{Name: "hello"},
+ client.WithResponseHeader(&responseHeader),
+ client.WithResponseTrailer(&responseTrailer),
+)
+if err != nil {
+ return err
+}
+
+headerValue := responseHeader.Get("X-Response-Token")
+trailerValue := responseTrailer.Get("X-Response-Trailer")
+_ = resp
+_ = headerValue
+_ = trailerValue
+```
+
+### 4.3 Streaming 响应 Header 和 Trailer
+
+对于生成的流式接口,响应 metadata 暴露在 stream 对象上。服务端通过 `ResponseHeader` 和 `ResponseTrailer` 写入响应 header 和 trailer:
+
+```go
+func (srv *GreetTripleServer) GreetStream(stream greet.GreetService_GreetStreamServer) error {
+ stream.ResponseHeader().Set("X-Stream-Response", "value")
+ stream.ResponseTrailer().Set("X-Stream-Trailer", "done")
+ // 处理 stream 消息
+ return nil
+}
+```
+
+客户端可以从生成的 stream 对象读取响应 metadata:
+
+```go
+stream, err := svc.GreetStream(ctx)
+if err != nil {
+ return err
+}
+
+headerValue := stream.ResponseHeader().Get("X-Stream-Response")
+trailerValue := stream.ResponseTrailer().Get("X-Stream-Trailer")
+_ = headerValue
+_ = trailerValue
+```
+
+完整可运行示例可参考 <a href="https://github.com/apache/dubbo-go-samples/tree/main/triple_header_trailer" target="_blank">dubbo-go-samples/triple_header_trailer</a>。
diff --git a/content/zh-cn/overview/mannual/golang-sdk/tutorial/rpc/filter.md b/content/zh-cn/overview/mannual/golang-sdk/tutorial/rpc/filter.md
index 999f21a90d1..fbf8d2b82a4 100644
--- a/content/zh-cn/overview/mannual/golang-sdk/tutorial/rpc/filter.md
+++ b/content/zh-cn/overview/mannual/golang-sdk/tutorial/rpc/filter.md
@@ -7,7 +7,11 @@ type: docs
weight: 7
---
-Filter 过滤器动态拦截请求(request)或响应(response)以转换或使用请求或响应中包含的信息。过滤器本身通常不会创建响应,而是提供可以“附加”到任何一次 RPC 请求的通用函数。Dubbo Filter 是可插拔的,我们可以在一次 RPC 请求中插入任意类型的、任意多个 Filter。
+示例源码:<a href="https://github.com/apache/dubbo-go-samples/tree/main/filter" target="_blank">dubbo-go-samples/filter</a>。
+
+Filter 过滤器会动态拦截请求(request)或响应(response),以转换或利用其中携带的信息。过滤器本身通常
+不会直接创建响应,而是提供可以“附加”到 RPC 调用链上的通用逻辑。Dubbo Filter 是可插拔的,因此我们
+可以在一次 Consumer 或 Provider 调用链中组合多个 Filter。
Filter 工作原理如下图所示:
@@ -30,44 +34,94 @@ type Filter interface {
}
```
-Filter 可以加载在 Consumer 端或者 Provider端。当加载在 Consumer 端,其Invoke函数调用的下游为网络层,OnResponse 为请求结束从网络层获取到返回结果后被调用。当加载在 Provider 端,其 Invoke 函数调用的下游为用户代码,OnResponse 为用户代码执行结束后向下传递至网络层前被调用。
+Filter 可以加载在 Consumer 端或者 Provider 端。当它加载在 Consumer 端时,`Invoke` 的下游是网络层,
+`OnResponse` 会在收到响应后被调用;当它加载在 Provider 端时,`Invoke` 的下游是用户代码,
+`OnResponse` 会在用户代码执行完成、响应写回网络前被调用。
+
+Filter 采用面向切面的设计思路,适合承载日志、指标、链路追踪、鉴权、流量保护、优雅停机、泛化调用适配
+等横切能力。
+
+### 2. Filter 的加载方式
+
+新项目建议优先按需引入具体的 filter:
+
+```go
+import _ "dubbo.apache.org/dubbo-go/v3/filter/echo"
+import _ "dubbo.apache.org/dubbo-go/v3/filter/generic"
+```
-Filter 采用面向切面设计的思路,通过对 Filter 的合理扩展,可以记录日志、设置数据打点,记录 invoker 所对应服务端性能,限流等等工作。
+如果你希望一次性引入 Dubbo Go SDK 中大部分内置能力,也可以直接使用:
-### 2. 框架预定义 Filter
+```go
+import _ "dubbo.apache.org/dubbo-go/v3/imports"
+```
+
+另外还保留了历史上的批量导入方式:
+
+```go
+import _ "dubbo.apache.org/dubbo-go/v3/filter/filter_impl"
+```
-框架预定义了一系列filter,可以在配置中直接使用,其代码实现位于 [filter](https://github.com/apache/dubbo-go/tree/main/filter)
+### 3. 框架内置 Filter
+
+框架内置了一系列 filter,可以在配置中直接启用,其代码实现位于
+[filter](https://github.com/apache/dubbo-go/tree/main/filter) 目录。
- accesslog
- active
-- sign: AuthConsumerFilter
-- auth: AuthProviderFilter
+- padasvc: Adaptive Service Provider Filter
+- sign: Auth Consumer Filter
+- auth: Auth Provider Filter
- echo
-- execute: ExecuteLimitFilter
-- generic: GenericFilter
-- generic_service: GenericServiceFilter
-- pshutdown: GracefulShutdownProviderFilter
-- cshutdown: GracefulShutdownConsumerFilter
-- hystrix_consumer: HystrixConsumerFilter
-- hystrix_provider: HystrixProviderFilter
+- execute: Execute Limit Filter
+- generic: Generic Consumer Filter
+- generic_service: Generic Provider Filter
+- pshutdown: Graceful Shutdown Provider Filter
+- cshutdown: Graceful Shutdown Consumer Filter
- metrics
+- otelServerTrace / otelClientTrace: OpenTelemetry Trace Filter
+- polaris-limit: Polaris 限流 Filter
- seata
- sentinel-provider
- sentinel-consumer
- token
- tps
-- tracing
+- tracing: Tracing Filter
+
+`hystrix_consumer` 和 `hystrix_provider` 属于更早版本中的能力。当前 3.3.x 文档重点展示主仓库和
+`imports` 包里仍然存在的内置 filter。
-### 3. 默认加载Filter
+### 4. 默认 Filter 链
-用户在配置文件中配置了自定义 Filter 加载策略时,框架将同时加载用户配置的 filters 和默认 filters,否则仅加载默认 filters。当前版本默认激活的 filter 列表如下:
+如果不手动覆盖配置,Dubbo Go SDK 默认会启用如下 filter 链:
- Consumer: cshutdown
-- Provider: echo, metrics, token, accesslog, tps, generic_service, executivete, pshutdown
+- Provider: echo, token, accesslog, tps, generic_service, execute, pshutdown
+
+在此基础上,还可能根据配置自动追加其他 filter,例如:
+
+- 开启 metrics 时追加 `metrics`
+- 开启 OpenTelemetry tracing 时追加 `otelServerTrace` 或 `otelClientTrace`
+- Provider 端开启 adaptive service 时追加 `padasvc`
+
+如果用户在配置文件中声明了自定义 filter 策略,框架会把用户配置和默认链合并,而不是简单把运行时默认能力全部替换掉。
+
+一个最小配置示例如下:
-### 4. 自定义Filter
+```yaml
+dubbo:
+ consumer:
+ filter: "metrics,tracing"
+ provider:
+ filter: "accesslog,tps"
+```
+
+如果是在根配置层声明,通常使用 `consumer.filter` 和 `provider.filter`;如果是在具体引用或服务配置里声明,
+则分别使用 `reference.filter` 和 `service.filter`。
+
+### 5. 自定义 Filter
-用户可在代码中自定义 Filter,注册到框架上,并在配置中选择使用。
+用户可以在代码中自定义 Filter,注册到框架上,并在配置中选择启用。
```go
func init() {
@@ -90,8 +144,3 @@ func (f *MyClientFilter) OnResponse(ctx context.Context, result protocol.Result,
return result
}
```
-
-## 完整示例
-可通过以下链接学习如何使用 API 配置和启用 Filter 的 <a href="https://github.com/apache/dubbo-go-samples/tree/main/filter" target="_blank">完整示例源码地址</a>
-
-
diff --git a/content/zh-cn/overview/mannual/golang-sdk/tutorial/rpc/openapi.md b/content/zh-cn/overview/mannual/golang-sdk/tutorial/rpc/openapi.md
index 639f551eab3..c936541950b 100644
--- a/content/zh-cn/overview/mannual/golang-sdk/tutorial/rpc/openapi.md
+++ b/content/zh-cn/overview/mannual/golang-sdk/tutorial/rpc/openapi.md
@@ -8,6 +8,8 @@ weight: 5
Dubbo-go 提供了内置的 OpenAPI 支持,可以自动为 Triple 协议服务生成符合 OpenAPI 3.0 规范的 API 文档,并通过 Swagger UI 和 ReDoc 提供 可视化的 API 浏览与调试界面。
+示例源码:<a href="https://github.com/apache/dubbo-go-samples/tree/main/rpc/triple/openapi" target="_blank">dubbo-go-samples/rpc/triple/openapi</a>。
+
## 功能概览
- **自动文档生成**:基于服务接口定义(protobuf IDL 或非 IDL 模式),自动生成 OpenAPI 3.0.1 规范的 API 文档
@@ -329,7 +331,6 @@ func main() {
启动后访问 `http://localhost:20000/dubbo/openapi/swagger-ui/` 即可查看 Swagger UI 文档界面。
-完整示例源码请参考 [dubbo-go-samples OpenAPI 示例](https://github.com/apache/dubbo-go-samples/tree/main/rpc/triple/openapi)。
## 架构说明
diff --git a/content/zh-cn/overview/mannual/golang-sdk/tutorial/rpc/protocol.md b/content/zh-cn/overview/mannual/golang-sdk/tutorial/rpc/protocol.md
index db3c75cc778..7c9dc0ba0b6 100644
--- a/content/zh-cn/overview/mannual/golang-sdk/tutorial/rpc/protocol.md
+++ b/content/zh-cn/overview/mannual/golang-sdk/tutorial/rpc/protocol.md
@@ -11,6 +11,11 @@ Dubbo-go 框架内置提供了两款协议:triple、dubbo,除此之外,框
* dubbo,基于 TCP 的高性能私有通信协议,缺点是通用性较差,更适合在 Dubbo SDK 间使用;
* 任意协议扩展,通过扩展 protocol 可以之前任意 RPC 协议,官方生态库提供 JsonRPC、thrift 等支持。
+相关示例:
+
+* Triple 协议:<a href="https://github.com/apache/dubbo-go-samples/tree/main/rpc/triple" target="_blank">dubbo-go-samples/rpc/triple</a>
+* 多协议发布:<a href="https://github.com/apache/dubbo-go-samples/tree/main/rpc/multi-protocols" target="_blank">dubbo-go-samples/rpc/multi-protocols</a>
+
本篇文档中,我们将介绍关于 triple 协议的使用方式、如何实现与已有 dubbo2 系统的互相调用、扩展更多协议支持等。更多原理性介绍请参考 [协议规范](/zh-cn/overview/reference/protocols/triple-spec/) 或者 [dubbo java 中相关描述文档](/zh-cn/overview/mannual/java-sdk/tasks/protocols/protocol/)。
## triple 协议
@@ -140,4 +145,3 @@ Dubbo 框架支持协议扩展,目前官方生态支持的协议包括:
在一些场景下,你可以在一个应用内同时发布多个协议的服务,或者同时以不同的协议调用服务,这里有一个 [多协议发布的使用示例](https://github.com/apache/dubbo-go-samples/tree/main/rpc/multi-protocols) 供参考。
-
diff --git a/content/zh-cn/overview/mannual/golang-sdk/tutorial/rpc/streaming.md b/content/zh-cn/overview/mannual/golang-sdk/tutorial/rpc/streaming.md
index 54d704db18d..1afad8cc4ec 100644
--- a/content/zh-cn/overview/mannual/golang-sdk/tutorial/rpc/streaming.md
+++ b/content/zh-cn/overview/mannual/golang-sdk/tutorial/rpc/streaming.md
@@ -4,6 +4,8 @@ title: 流式通信
type: docs
weight: 1
---
+示例源码:<a href="https://github.com/apache/dubbo-go-samples/tree/main/streaming" target="_blank">dubbo-go-samples/streaming</a>。
+
Streaming 流式通信是 Dubbo3 新提供的一种 RPC 数据传输模式,适用于以下场景:
- 接口需要发送大量数据,这些数据无法被放在一个 RPC 的请求或响应中,需要分批发送,但应用层如果按照传统的多次 RPC 方式无法解决顺序和性能的问题,如果需要保证有序,则只能串行发送
@@ -17,11 +19,12 @@ Streaming 流式通信类型分为以下三种:
## 1.介绍
-本文档演示如何在 Dubbo-go 中使用流式通信,可在此查看 <a href="https://github.com/apache/dubbo-go-samples/tree/main/streaming" target="_blank">完整示例源码地址</a>。
+本文档演示如何在 Dubbo-go 中使用流式通信。
## 2.如何使用Dubbo-go流式通信
-在proto文件中需要流式通信的方法的参数前面添加stream,使用proto-gen-triple生成相应文件
+在 proto 文件中,为需要流式通信的方法请求类型或响应类型添加 `stream`,然后使用 `protoc-gen-go-triple`
+生成对应代码。
```protobuf
service GreetService {
@@ -195,6 +198,42 @@ func testServerStream(cli greet.GreetService) error {
}
```
+流式调用也可以通过生成的 stream API 读写 Triple metadata:
+
+| 位置 | API | 用途 |
+| ---- | --- | ---- |
+| 客户端流和双向流 client | `RequestHeader()` | 在发送第一条消息前写入请求 metadata |
+| 服务端流和双向流 client | `ResponseHeader()` | 读取服务端返回的响应 header |
+| 服务端流和双向流 client | `ResponseTrailer()` | 响应结束后读取服务端返回的 trailer |
+| Provider 侧 stream handler | `RequestHeader()` | 读取客户端发送的请求 metadata |
+| Provider 侧 stream handler | `ResponseHeader()` / `ResponseTrailer()` | 设置响应 header 和 trailer |
+
+这些 metadata 使用 `http.Header` 表示,可以用 `Set`、`Add`、`Get`、`Values` 等标准方法读写。
+
+例如,在 client 侧可以在发送第一条消息前写入请求 metadata:
+
+```go
+stream, err := cli.GreetStream(context.Background())
+if err != nil {
+ return err
+}
+stream.RequestHeader().Set("x-sample-token", "demo-token")
+```
+
+在服务端 stream handler 中,也可以返回响应 metadata:
+
+```go
+func (srv *GreetTripleServer) GreetServerStream(
+ ctx context.Context,
+ req *greet.GreetServerStreamRequest,
+ stream greet.GreetService_GreetServerStreamServer,
+) error {
+ stream.ResponseHeader().Set("x-stream-header", "ready")
+ stream.ResponseTrailer().Set("x-stream-trailer", "done")
+ return nil
+}
+```
+
## 3.运行效果
运行服务端和客户端,可以看到请求正常返回
@@ -213,4 +252,3 @@ TRIPLE server stream resp: [triple]
TRIPLE server stream resp: [triple]
TRIPLE server stream resp: [triple]
```
-
diff --git a/content/zh-cn/overview/mannual/golang-sdk/tutorial/service-discovery/application-level-service-discovery.md b/content/zh-cn/overview/mannual/golang-sdk/tutorial/service-discovery/application-level-service-discovery.md
new file mode 100644
index 00000000000..656704ca4d5
--- /dev/null
+++ b/content/zh-cn/overview/mannual/golang-sdk/tutorial/service-discovery/application-level-service-discovery.md
@@ -0,0 +1,150 @@
+---
+description: "说明 dubbo-go 应用级服务发现的注册数据、metadata 模式和默认 metadata service 配置。"
+title: 应用级服务发现
+type: docs
+weight: 12
+---
+
+dubbo-go 支持接口级注册和应用级服务发现。接口级注册会把可调用的 provider URL 直接写入注册中心;应用级服务发现会把应用实例写入注册中心,再通过服务映射和 metadata 还原 consumer 调用所需的 provider URL。
+
+应用级服务发现是当前默认模型。接口级注册和应用级服务发现使用不同的注册与订阅路径,二者不会自动互通。使用接口级发现的 consumer 无法发现只注册应用级实例的 provider;使用应用级服务发现的 consumer 也无法发现只注册接口级 URL 的 provider。如果迁移阶段需要同时支持两类 consumer,可以使用 `all`。
+
+## 注册模式
+
+可以通过 registry type 选择 provider 的注册方式:
+
+| Registry type | API 配置 | 注册内容 |
+| --- | --- | --- |
+| `interface` | `registry.WithRegisterInterface()` | provider URL,例如 `tri://host:port/interface` 或 `rest://host:port/interface`。 |
+| `service` | `registry.WithRegisterService()` | 应用实例和实例 metadata。consumer 先发现实例,再通过 metadata 解析 provider URL。 |
+| `all` | `registry.WithRegisterServiceAndInterface()` | 同时注册应用级实例和接口级 provider URL,适合迁移阶段使用。 |
+
+示例:
+
+```go
+ins, _ := dubbo.NewInstance(
+ dubbo.WithName("demo-provider"),
+ dubbo.WithRegistry(
+ registry.WithNacos(),
+ registry.WithAddress("127.0.0.1:8848"),
+ registry.WithRegisterService(),
+ ),
+)
+```
+
+如果使用配置文件,可以将 `registry-type` 设置为 `service`、`interface` 或 `all`。如果对注册方式有明确要求,建议显式配置。
+
+## 注册中心存储什么
+
+在应用级服务发现中,注册中心不会把完整的可调用 provider URL 作为主要注册数据,而是存储应用级数据,例如:
+
+- 应用名;
+- 实例 host 和 port;
+- 实例 metadata;
+- 暴露服务的 revision;
+- metadata 存储类型;
+- metadata service URL 参数;
+- service 到 application 的映射关系。
+
+consumer 会先查询某个服务由哪些应用提供,再订阅这些应用实例,最后通过 metadata 还原服务级 provider URL。
+
+## Metadata 模式
+
+应用级服务发现需要 provider metadata。dubbo-go 支持 local 和 remote 两种 metadata 存储模式。
+
+### Local Metadata
+
+`local` 是当前默认模式。
+
+在 local metadata 模式下,provider 将 `MetadataInfo` 保存在本地,并暴露 metadata service。provider 会把实例 revision 和 metadata service URL 参数写入注册中心。consumer 从 provider instance 中读取这些参数,再调用 provider 的 metadata service 拉取 `MetadataInfo`。
+
+流程如下:
+
+```text
+provider -> registry: application instance + revision + metadata service URL params
+consumer -> registry: discover provider instance
+consumer -> provider metadata service: get MetadataInfo by revision
+```
+
+metadata service 的 RPC 协议由 `metadata-service-protocol` 控制。当前默认值是 `dubbo`,也可以显式配置:
+
+```go
+ins, _ := dubbo.NewInstance(
+ dubbo.WithName("demo-provider"),
+ dubbo.WithMetadataServiceProtocol("tri"),
+)
+```
+
+provider 和 consumer 不需要配置相同的 `metadata-service-protocol`。provider 会把实际使用的 metadata service protocol 写入实例 metadata,consumer 根据 provider 广播出来的协议调用 metadata service。consumer 运行时需要具备调用该协议的能力。
+
+### Remote Metadata
+
+在 remote metadata 模式下,provider 通过 metadata report 将 `MetadataInfo` 上报到 metadata center。consumer 从 metadata center 读取 metadata,而不是调用 provider 的 metadata service。
+
+流程如下:
+
+```text
+provider -> metadata center: report MetadataInfo
+provider -> registry: application instance + revision
+consumer -> registry: discover provider instance
+consumer -> metadata center: read MetadataInfo by revision
+```
+
+可以通过 `dubbo.WithRemoteMetadata()` 开启 remote metadata,并配置 metadata report:
+
+```go
+ins, _ := dubbo.NewInstance(
+ dubbo.WithName("demo-provider"),
+ dubbo.WithRemoteMetadata(),
+ dubbo.WithMetadataReport(
+ metadata.WithProtocol("nacos"),
+ metadata.WithAddress("127.0.0.1:8848"),
+ ),
+)
+```
+
+也可以复用 registry 作为 metadata report。registry 默认 `use-as-meta-report=true`,除非显式设置 `registry.WithoutUseAsMetaReport()`。
+
+```go
+ins, _ := dubbo.NewInstance(
+ dubbo.WithName("demo-provider"),
+ dubbo.WithRemoteMetadata(),
+ dubbo.WithRegistry(
+ registry.WithNacos(),
+ registry.WithAddress("127.0.0.1:8848"),
+ registry.WithRegisterService(),
+ ),
+)
+```
+
+remote metadata 模式下,provider 和 consumer 都需要能够访问同一个 metadata center。此时 consumer 不会调用 provider 的 metadata service,因此 `metadata-service-protocol` 不参与 remote metadata 读取链路。
+
+## 当前默认值
+
+| 配置项 | 当前默认值 |
+| --- | --- |
+| `metadata-type` | `local` |
+| `metadata-service-protocol` | `dubbo` |
+| registry `use-as-meta-report` | `true` |
+| registry `use-as-config-center` | `true` |
+| 默认注册和发现模型 | 应用级服务发现,`registry.WithRegisterService()` 或 `registry-type: service` |
+
+## 隐式默认值与行为
+
+有一些行为在配置未显式填写时会自动推导,比较容易被忽略:
+
+- 如果没有配置 `registry-type`,dubbo-go 会回退到应用级注册与发现。
+- 应用级 consumer 在 reference 没有显式指定业务协议时,会默认按 `tri` 订阅。
+- `metadata-type` 默认是 `local`,因此如果没有显式开启 remote metadata,consumer 会通过 provider 的 metadata service 拉取 metadata。
+- 在 local metadata 模式下,`metadata-service-protocol` 默认是 `dubbo`。
+- 如果没有配置 `metadata-service-port`,metadata service 会优先复用默认协议端口;如果拿不到可用端口,则回退为随机端口。
+- registry 默认 `use-as-meta-report=true`,所以只要不显式设置 `registry.WithoutUseAsMetaReport()`,registry 可以直接复用为 metadata report center。
+- registry 还默认 `use-as-config-center=true`,所以只要不显式设置 `registry.WithoutUseAsConfigCenter()`,同一个 registry 也可能被复用为 config center。
+
+## 使用建议
+
+- 应用级服务发现使用 `service` 注册。
+- 迁移阶段如果仍有接口级 consumer,可以使用 `all`。
+- 简单部署和示例优先使用 local metadata。
+- 如果已经有 metadata center,并且希望 consumer 不直接调用 provider metadata RPC,可以使用 remote metadata。
+- local metadata 模式下,如果不希望使用默认 metadata transport,建议显式配置 `metadata-service-protocol`。
diff --git a/content/zh-cn/overview/mannual/golang-sdk/tutorial/service-discovery/nacos.md b/content/zh-cn/overview/mannual/golang-sdk/tutorial/service-discovery/nacos.md
index f5369961011..d32863d80d6 100644
--- a/content/zh-cn/overview/mannual/golang-sdk/tutorial/service-discovery/nacos.md
+++ b/content/zh-cn/overview/mannual/golang-sdk/tutorial/service-discovery/nacos.md
@@ -9,7 +9,9 @@ weight: 10
---
-This example shows dubbo-go's service discovery feature with Nacos as registry.
+本文演示 dubbo-go 使用 Nacos 作为注册中心的服务发现能力,可在
+<a href="https://github.com/apache/dubbo-go-samples/tree/main/registry/nacos" target="_blank">dubbo-go-samples/registry/nacos</a>
+查看完整示例源码。
## 使用方式
@@ -55,4 +57,4 @@ Open `https://localhost:8848/nacos/` with browser, check url address successfull
```shell
$ go run ./go-client/cmd/client.go
hello world
-```
\ No newline at end of file
+```
diff --git a/content/zh-cn/overview/mannual/golang-sdk/tutorial/service-discovery/zookeeper.md b/content/zh-cn/overview/mannual/golang-sdk/tutorial/service-discovery/zookeeper.md
index 257c969da34..561b57e454d 100644
--- a/content/zh-cn/overview/mannual/golang-sdk/tutorial/service-discovery/zookeeper.md
+++ b/content/zh-cn/overview/mannual/golang-sdk/tutorial/service-discovery/zookeeper.md
@@ -9,7 +9,9 @@ weight: 11
---
-This example shows dubbo-go's service discovery feature with Zookeeper as registry.
+本文演示 dubbo-go 使用 Zookeeper 作为注册中心的服务发现能力,可在
+<a href="https://github.com/apache/dubbo-go-samples/tree/main/registry/zookeeper" target="_blank">dubbo-go-samples/registry/zookeeper</a>
+查看完整示例源码。
## 使用方式
@@ -65,4 +67,3 @@ $ ./zkCli.sh
$ go run ./go-client/cmd/client.go
hello world
```
-
diff --git a/content/zh-cn/overview/mannual/golang-sdk/tutorial/traffic/condition_router.md b/content/zh-cn/overview/mannual/golang-sdk/tutorial/traffic/condition_router.md
index c33b1fc8645..aca984efa42 100644
--- a/content/zh-cn/overview/mannual/golang-sdk/tutorial/traffic/condition_router.md
+++ b/content/zh-cn/overview/mannual/golang-sdk/tutorial/traffic/condition_router.md
@@ -5,6 +5,11 @@ type: docs
weight: 1
---
+相关示例:
+
+- 动态 condition router:<a href="https://github.com/apache/dubbo-go-samples/tree/main/router/condition" target="_blank">dubbo-go-samples/router/condition</a>
+- 静态 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>
+
## 使用方法
### 前置准备
diff --git a/content/zh-cn/overview/mannual/golang-sdk/tutorial/traffic/script_router.md b/content/zh-cn/overview/mannual/golang-sdk/tutorial/traffic/script_router.md
index 8b54831c2ea..157f91a6661 100644
--- a/content/zh-cn/overview/mannual/golang-sdk/tutorial/traffic/script_router.md
+++ b/content/zh-cn/overview/mannual/golang-sdk/tutorial/traffic/script_router.md
@@ -5,6 +5,8 @@ type: docs
weight: 1
---
+示例源码:<a href="https://github.com/apache/dubbo-go-samples/tree/main/router/script" target="_blank">dubbo-go-samples/router/script</a>。
+
## 使用方法
### 前置准备
@@ -45,5 +47,3 @@ script: |
|--------|--------------------|
| type | script的类型,目前仅可使用js |
| script | script实际内容 |
-
-完整示例请见: [本示例完整代码](https://github.com/apache/dubbo-go-samples/tree/main/router/script)。
\ No newline at end of file
diff --git a/content/zh-cn/overview/mannual/golang-sdk/tutorial/traffic/tag_router.md b/content/zh-cn/overview/mannual/golang-sdk/tutorial/traffic/tag_router.md
index 9fad21cf0ae..cb8cdf35e6a 100644
--- a/content/zh-cn/overview/mannual/golang-sdk/tutorial/traffic/tag_router.md
+++ b/content/zh-cn/overview/mannual/golang-sdk/tutorial/traffic/tag_router.md
@@ -5,6 +5,11 @@ type: docs
weight: 1
---
+相关示例:
+
+- 动态 tag router:<a href="https://github.com/apache/dubbo-go-samples/tree/main/router/tag" target="_blank">dubbo-go-samples/router/tag</a>
+- 静态 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>
+
## 使用方法
### 前置准备
diff --git a/content/zh-cn/overview/mannual/golang-sdk/versions.md b/content/zh-cn/overview/mannual/golang-sdk/versions.md
index 51a19f33c0e..ba400cddae1 100644
--- a/content/zh-cn/overview/mannual/golang-sdk/versions.md
+++ b/content/zh-cn/overview/mannual/golang-sdk/versions.md
@@ -11,33 +11,44 @@ weight: 1
## 推荐版本
-当前网站文档适用于以下版本,如果您正使用 dubbo-go 其他版本,请参考对应历史版本文档。
+当前网站文档面向仍在维护的 Dubbo Go SDK 3.3.x 版本线。如果你正在使用其他 dubbo-go 版本,请参考对应的历史文档和发布说明。
-| Go | Dubbo-go | protoc-gen-go-triple | 说明 |
-|:----:|------------------|------------------------------------------------------------|---------------|
-| 1.20 | v3.2.0-rc1(当前文档) | [v3.0.0](https://github.com/dubbogo/protoc-gen-go-triple/) | 当前最新稳定版本,推荐使用 |
+| Go | Dubbo-go | protoc-gen-go-triple | 说明 |
+|:----:|-----------------|------------------------------------------------------------|----------------------------|
+| 1.25 | v3.3.2-20260419 | [仓库内置工具](https://github.com/apache/dubbo-go/tree/main/tools/protoc-gen-go-triple) | 当前 3.3.2 日期标签,匹配主干文档 |
+| 1.24 | v3.3.1 | [仓库内置工具](https://github.com/apache/dubbo-go/tree/main/tools/protoc-gen-go-triple) | 3.3.x 常规发布版本,推荐新项目使用 |
+
+{{% alert title="说明" color="primary" %}}
+新项目建议优先使用同一个 3.3.x 版本线里的最新 patch 版本。当前 3.x 项目生成 Triple 代码时建议使用
+dubbo-go 仓库 `tools/protoc-gen-go-triple` 目录下内置的 `protoc-gen-go-triple` 工具。
+{{% /alert %}}
+
+{{% alert title="历史说明" color="secondary" %}}
+更早的 3.x 版本文档里可能会引用独立的 `protoc-gen-go-triple` 或 `dubbogo-cli` 仓库。下表保留这些链接,
+仅用于对应历史版本的上下文说明;当前工具入口已经迁回 dubbo-go 主仓库 `tools/` 目录。
+{{% /alert %}}
## 历史版本
### 3.x
-查看 3.1.x 及之前版本文档:
+查看更早的 3.x 版本文档:
| Go | Dubbo-go | protoc-gen-go-triple | 说明 |
|:----:|--------------|------------------------------------------------------------|--------------------------------------|
+| 1.20 | v3.2.0-rc1 | [v3.0.0](https://github.com/dubbogo/protoc-gen-go-triple/) | 较早的 RC 文档;需要当前能力时建议升级到 3.3.x 版本线 |
| 1.16 | v3.1.1 | [v3.0.0](https://github.com/dubbogo/protoc-gen-go-triple/) | 请参考 README 说明,了解如何生成老版本兼容的服务 stub 代码 |
| 1.16 | v3.1.0 | [v3.0.0](https://github.com/dubbogo/protoc-gen-go-triple/) | 请参考 README 说明,了解如何生成老版本兼容的服务 stub 代码 |
| 1.16 | v3.0.4 | [v3.0.0](https://github.com/dubbogo/protoc-gen-go-triple/) | 请参考 README 说明,了解如何生成老版本兼容的服务 stub 代码 |
| 1.16 | v3.0.3 | [v3.0.0](https://github.com/dubbogo/protoc-gen-go-triple/) | 请参考 README 说明,了解如何生成老版本兼容的服务 stub 代码 |
| 1.16 | v3.0.2 | [v3.0.0](https://github.com/dubbogo/protoc-gen-go-triple/) | 请参考 README 说明,了解如何生成老版本兼容的服务 stub 代码 |
| 1.16 | v3.0.1 | [v3.0.0](https://github.com/dubbogo/protoc-gen-go-triple/) | 请参考 README 说明,了解如何生成老版本兼容的服务 stub 代码 |
-| 1.16 | v3.0.0 | [v1.0.5](https://github.com/dubbogo/dubbogo-cli) | |
-| 1.16 | v3.0.0-rc4-1 | [v1.0.2](https://github.com/dubbogo/dubbogo-cli) | |
-| 1.16 | v3.0.0-rc3 | [v1.0.0](https://github.com/dubbogo/dubbogo-cli) | |
+| 1.16 | v3.0.0 | [v1.0.5](https://github.com/dubbogo/dubbogo-cli) | CLI 在迁回 dubbo-go 主仓库前的历史打包方式 |
+| 1.16 | v3.0.0-rc4-1 | [v1.0.2](https://github.com/dubbogo/dubbogo-cli) | CLI 在迁回 dubbo-go 主仓库前的历史打包方式 |
+| 1.16 | v3.0.0-rc3 | [v1.0.0](https://github.com/dubbogo/dubbogo-cli) | CLI 在迁回 dubbo-go 主仓库前的历史打包方式 |
### 1.x
| Go | Dubbo-go | Triple | protoc-gen-go-triple | 说明 |
|:--:|----------|--------|----------------------|--------------------|
| | v1.5.0 | v1.1.8 | v1.0.8 | 停止维护,请升级到最新 3.x 版本 |
-
diff --git a/content/zh-cn/overview/what/core-features/extensibility.md b/content/zh-cn/overview/what/core-features/extensibility.md
index baa33c627f1..3ccac1457c4 100644
--- a/content/zh-cn/overview/what/core-features/extensibility.md
+++ b/content/zh-cn/overview/what/core-features/extensibility.md
@@ -120,4 +120,4 @@ Dubbo 官方支持 Zookeeper、Nacos、Etcd、Redis 等元数据中心实现。
本文列出了 Dubbo 常用的一些扩展点,但还有大量的扩展点可供灵活定制,并且不同语言 sdk 的扩展定义和配置方式上也存在差异,以下是 Dubbo SDK 的扩展点手册。
* [Java 扩展点手册](../../mannual/java-sdk/reference-manual/spi/description/)
-* [Go 扩展点手册](../../mannual/golang-sdk/refer/sourcecode/aop_and_extension.md)
+* [Go 扩展点手册](../../mannual/golang-sdk/sourcecode/aop_and_extension/)
diff --git a/content/zh-cn/overview/what/core-features/protocols.md b/content/zh-cn/overview/what/core-features/protocols.md
index 9158ba0ecd6..164954a49eb 100644
--- a/content/zh-cn/overview/what/core-features/protocols.md
+++ b/content/zh-cn/overview/what/core-features/protocols.md
@@ -82,7 +82,7 @@ gRPC 是谷歌开源的基于 HTTP/2 的通信协议,如同我们在 [产品
以上协议的配置和使用方式,包括如何配置 `单端口多协议` 支持等,请参照以下 sdk 示例文档:
* [Java](../../mannual/java-sdk/reference-manual/protocol/)
-* [Golang](../../mannual/golang-sdk/refer/sourcecode/protocol.md)
+* [Golang](../../mannual/golang-sdk/sourcecode/protocol/)
* [Rust](../../mannual/rust-sdk/)
## 自定义扩展
diff --git a/content/zh-cn/overview/what/core-features/service-discovery.md b/content/zh-cn/overview/what/core-features/service-discovery.md
index 53acb173ab9..2c3b0e695d9 100644
--- a/content/zh-cn/overview/what/core-features/service-discovery.md
+++ b/content/zh-cn/overview/what/core-features/service-discovery.md
@@ -64,7 +64,7 @@ Dubbo 提供的是一种 Client-Based 的服务发现机制,依赖第三方注
Dubbo 服务发现扩展了多种注册中心组件支持,如 Nacos、Zookeeper、Consul、Redis、kubernetes 等,可以通过配置切换不同实现,同时还支持鉴权、命名空间隔离等配置。具体配置方式请查看 SDK 文档
* [Java](../../mannual/java-sdk/reference-manual/registry)
-* [Golang](../../mannual/golang-sdk/refer/sourcecode/registry.md)
+* [Golang](../../mannual/golang-sdk/sourcecode/registry/)
* [Rust](../../mannual/rust-sdk/)
Dubbo 还支持一个应用内配置多注册中心的情形如双注册、双订阅等,这对于实现不同集群地址数据互通、集群迁移等场景非常有用处,我们将在未来文档中添加 `最佳实践` 对这部分内容进行示例说明。
diff --git a/static/imgs/golang/architecture/arc.png b/static/imgs/golang/architecture/arc.png
index d0ea10991e5..b6fa047fafb 100644
Binary files a/static/imgs/golang/architecture/arc.png and b/static/imgs/golang/architecture/arc.png differ