Core 3.x Capabilities

Current Dubbo Go 3.x core capabilities

Related samples:

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:

ModeAPIMeaning
serviceregistry.WithRegisterService()Register application-level instances. This is the recommended default.
interfaceregistry.WithRegisterInterface()Register interface-level provider URLs.
allregistry.WithRegisterServiceAndInterface()Register both models during migration.

See 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.