zbchi opened a new pull request, #3164:
URL: https://github.com/apache/dubbo-go/pull/3164
### Description
Fixes #3163
#### Root Cause
In the new API workflow, the application name is stored in the attributes of
the service URL. However, the Polaris router is initialized using the registry
URL during the construction of the router chain. Since the registry URL does
not carry the application name information, it fails the validation check in
the Polaris router.
#### Solution
Modify the Refer method in registry/protocol/protocol.go. Synchronize the
application name from the serviceUrl to the registryUrl. This ensures that all
downstream routers (including Polaris) can correctly access the application
identity.
#### Changes
File: registry/protocol/protocol.go
In the Refer method, add the following logic to pass the application name:
```go
// copy application name from service URL to registry URL for routers that
need it
if appName := serviceUrl.GetParam(constant.ApplicationKey, ""); appName !=
"" {
registryUrl.SetParam(constant.ApplicationKey, appName)
}
```
### 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]