Related samples:
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 is shared by all services and references inside one Dubbo Go process.
In configuration-file mode, that model is represented by config.RootConfig:
ApplicationProtocolsRegistriesConfigCenterMetadataReportProviderConsumerOtelMetricsTracingLoggerShutdownRouterTLSConfigIn 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 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.ServiceOptionsThis layer carries interface name, implementation handler, protocol IDs, registry IDs, serialization, and service metadata.
On the consumer side, the main unit is a reference:
client.DialWithInfo(...)client.DialWithService(...)client.NewGenericService(...)This layer carries interface name, URL or registry target, protocol selection, group/version, timeout, and per-reference routing or metadata behavior.
The distinction is especially important in current Dubbo Go because application-level service discovery is now common.
At the application level, Dubbo Go manages:
At the interface level, Dubbo Go manages:
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.
A single Dubbo Go process can contain both provider and consumer roles at the same time. In practice:
This is the runtime reason behind the directory and package split you see in server, client, registry, metadata, and protocol.