Aetherance commented on issue #3250:
URL: https://github.com/apache/dubbo-go/issues/3250#issuecomment-4060222474
```go
func (p *PriorityRouter) Route(invokers []base.Invoker, url *common.URL,
invocation base.Invocation) []base.Invoker {
// ...
// get prefix from invoker
application := invokers[0].GetURL().GetParam(constant.Tagkey, "")
key := strings.Join([]string{application,
constant.TagRouterRuleSuffix}, "")
value, ok := p.routerConfigs.Load(key)
// ...
}
```
```go
func (p *PriorityRouter) Notify(invokers []base.Invoker) {
application := invokers[0].GetURL().GetParam(constant.ApplicationKey,
"")
if application == "" {
logger.Warn("url application is empty, tag router will not be
enabled")
return
}
// ...
key := strings.Join([]string{application,
constant.TagRouterRuleSuffix}, "")
// ...
p.Process(&config_center.ConfigChangeEvent{Key: key, Value: value,
ConfigType: remoting.EventTypeAdd})
}
func (p *PriorityRouter) Process(event *config_center.ConfigChangeEvent) {
// ...
p.routerConfigs.Store(event.Key, *routerConfig)
logger.Infof("[tag router]Parse tag router config
success,routerConfig=%+v", routerConfig)
}
```
--
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]