Dubbo + Nacos: Verify the Registration Name and group/version First, Then Run a Real Smoke Test
ENGINEERING NOTES
Published / DavidHLPL
Conclusion first: Troubleshooting Dubbo + Nacos cannot stop at “there are instances in the registry”. First verify the interface-level service name providers:{interface}:{version}:{group}, the Nacos group, the provider URL metadata, and the consumer’s version/group subscription conditions, then decide whether application-level discovery is needed. The default register-mode=all can produce both the application-name service and the interface-level service at the same time; only a real Nacos provider/consumer smoke test can prove end-to-end RPC.
Version and scope
This page is based on the Apache Dubbo dubbo-3.3.6 pinned commit f1585880bee4ca7776f44380c47c994217721ffe and the official Nacos registry documentation. The documentation targets Nacos 2.x and its examples recommend Dubbo 3.3.0 + Nacos 2.3.0; this is not a compatibility promise for every Dubbo/Nacos combination.
1. The interface-level registration name must match exactly
A provider’s interface-level service name is:
providers:{interface}:{version}:{group}
where:
providersis the default category;interfaceis the fully qualified name of the service interface;- empty version/group segments are still preserved;
- the Nacos group defaults to
DEFAULT_GROUPand can be changed withdubbo.registry.group; - the Nacos instance metadata contains the complete provider URL parameters.
When troubleshooting, check at least all of the following at once:
service name + Nacos group + version + provider metadata
Seeing the same IP/port or “instance healthy” cannot prove that the consumer’s subscription conditions are satisfied.
2. Default configuration can produce both application-level and interface-level services
Application-level registration uses dubbo.application.name as the Nacos service name, and the metadata can include:
dubbo.metadata-service.url-params;meta-v;dubbo.metadata.storage-type=local;dubbo.metadata.revision;dubbo.endpointsin multi-protocol scenarios.
The default register-mode=all registers both application-level and interface-level services; instance and interface keep only the corresponding level. Do not mistake “only providers services are visible” for application-level discovery being disabled, and do not treat the application-name service as an interface-level provider list.
3. The consumer has two discovery paths
Interface-level
The consumer subscribes to the same-name providers:... service, and instances are pushed by Nacos naming events. version/group must match strictly; use * or comma expressions only when a range is needed.
Application-level
Application-level discovery depends on Nacos Config mapping and the MetadataService RPC:
- the mapping group is
mapping; - the migration default policy is
APPLICATION_FIRST; - application name, interface name, and metadata revision are different fields.
The two paths differ in configuration, service name, and failure behavior; you must first determine the current register-mode.
4. Startup checks and runtime failures
A minimal example that does not confuse URL parameters with top-level configuration:
dubbo.registry.address=nacos://127.0.0.1:8848?nacos.check=true&retry.period=5000®ister-consumer-url=false
dubbo.registry.group=DEFAULT_GROUP
dubbo.registry.check=true
dubbo.registry.enable-empty-protection=false
dubbo.registry.register-mode=all
nacos.check, retry.period, and register-consumer-url are registry URL parameters and can be written in the address query or dubbo.registry.parameters.*; enable-empty-protection is additionally confirmed to have the top-level declaration dubbo.registry.enable-empty-protection. The namespace defaults to public and is passed through directly to the Nacos client.
Separate startup from runtime:
- the provider first exports/binds the port locally, then registers with the registry; when Nacos is unreachable and
nacos.check=true, startup fails; - the consumer’s
check=trueby default requires a provider to exist at startup, otherwise it throwsNo provider available for the service; - when no instance is available at runtime, the default fail-fast route can throw
FORBIDDEN No provider available from registry; - failback retries on a 5-second cycle by default, but does not turn the first startup check into a success.
5. The Nacos heartbeat boundary belongs to the server
The default keepalive values from the official materials are:
preserved.heart.beat.interval=5000ms;- instances are marked unhealthy after
preserved.heart.beat.timeout=15000ms; - instances are deleted after
preserved.ip.delete.timeout=30000ms.
These values belong to Nacos server behavior, not to a stable guarantee of the Dubbo registry itself. Re-check them when the deployment version or server-side configuration changes.
Minimal real smoke test
With a pinned local Nacos 2.x and provider/consumer fixtures, verify in this order:
- With Nacos not started, observe the provider’s
nacos.checkfailure and the consumer’scheckfailure separately; - After Nacos starts, confirm the exact
providers:{interface}:{version}:{group}service name; - Check whether the metadata contains protocol, path, methods, version, group;
- Under the default
register-mode=all, confirm that the application-name service and providers services coexist; after switching toinstance/interface, confirm only one level remains; - Complete one real RPC;
- With provider
1.1.0and consumer1.0.0, confirm the mismatch fails fast, and withversion=*confirm the allowed range is discoverable; - After the provider goes offline, calls fail; after restart and re-registration, calls recover.
The tests bundled with dubbo registry-nacos mostly mock NamingService and cannot replace a real Nacos integration test. This page does not set the smoke test as an executed result.
Common misconceptions and boundaries
- “Nacos having an instance means it can be called.” Any mismatch in service name, group, version, or metadata can make it undiscoverable.
- “Only one kind of registration by default.”
register-mode=allcan have both application-level and interface-level services. - “
retry.periodis a plain top-level key.” The current pinned evidence first proves it is a registry URL parameter; do not treat the unverified flat form as general syntax. - “Heartbeat timeout is decided by Dubbo.”
preserved.*is the Nacos server boundary. - “Mock NamingService tests prove end-to-end availability.” A real Nacos, version matching, and provider-offline recovery still need a smoke test.
Evidence boundary
Pinned commits, official docs, config key corrections, and unverified items are in the repository’s src/content/raw/zh-cn/dubbo-nacos-runtime-registration.md and dubbo-nacos-runtime-registration-correction.md. This page contains no private addresses, credentials, or specific business service names.
Sources and related documents
Research notes
- Original document: src/content/note/en/dubbo-nacos-runtime.md
- Source revision: f49953fb0d4bd52a39bf81167b0c4b7dd7d78a64
- Evidence status: active