mochengqian opened a new pull request, #3309: URL: https://github.com/apache/dubbo-go/pull/3309
### Description Fixes #3302 ### Why When registering multiple providers under the same Nacos service, if these providers correspond to different metadata revisions, the consumer-side listener may only retain one provider when aggregating the URL, causing a `No provider available` error when dynamically switching to another provider. Additionally, the `environment` set by the provider via `dubbo.WithEnvironment(...)` is not included in the service metadata/instance metadata. The consumer-side URL lacks this attribute, and the condition/script/tag router cannot correctly match by `environment`. ### Root Cause: Multiple providers are registered, but the listener reuses/overwrites URLs with incorrect granularity. The environment is not included in the routable metadata. ### PR Goal: Fix the issue where the consumer directory only exposes one invoker in Nacos service discovery scenarios with multiple providers. Enable the environment to be included in service metadata/instance metadata/consumer URLs, supporting dynamic routing. ### Success Criteria: Consumer URLs can be generated across multiple revisions/providers for the same service. The directory is refreshed according to the current instance after provider remove/restart. The environment is visible in condition/script/tag router. ### Paths this PR should affect: metadata/info registry/servicediscovery Entry URL metadata in the registry directory/router ### Revise Adding environment to IncludeKeys: resolves missing routable attributes in consumer URLs. Writing instance metadata to createInstance: resolves missing raw instance metadata in Nacos. Changing listener aggregation from pointer/set to serviceKey -> revision -> ServiceInfo: resolves issues of multiple revisions overwriting/reusing the same service. Provider remove/restart testing: proves that old URLs are not left in the directory and are not lost upon provider restart. ### Checklist - [x] I confirm the target branch is `develop` - [x] Code has passed local testing - [x] I have added tests that prove my fix is effective or that my feature works -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
