This is an automated email from the ASF dual-hosted git repository.
liujun pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/dubbo-go.git
The following commit(s) were added to refs/heads/main by this push:
new 4f21a4160 merge #2559 into main branch (#2568)
4f21a4160 is described below
commit 4f21a416050093c4b90de08f419769eb459aaf7b
Author: finalt <[email protected]>
AuthorDate: Mon Jan 8 10:16:29 2024 +0800
merge #2559 into main branch (#2568)
---
cluster/router/condition/dynamic_router.go | 15 ++++++++-------
cluster/router/tag/router.go | 2 +-
2 files changed, 9 insertions(+), 8 deletions(-)
diff --git a/cluster/router/condition/dynamic_router.go
b/cluster/router/condition/dynamic_router.go
index c02d0a09d..90245b910 100644
--- a/cluster/router/condition/dynamic_router.go
+++ b/cluster/router/condition/dynamic_router.go
@@ -124,7 +124,7 @@ func (s *ServiceRouter) Notify(invokers []protocol.Invoker)
{
dynamicConfiguration := conf.GetEnvInstance().GetDynamicConfiguration()
if dynamicConfiguration == nil {
- logger.Warnf("config center does not start, please check if the
configuration center has been properly configured in dubbogo.yml")
+ logger.Infof("Config center does not start, Condition router
will not be enabled")
return
}
key := strings.Join([]string{url.ColonSeparatedKey(),
constant.ConditionRouterRuleSuffix}, "")
@@ -171,6 +171,13 @@ func (a *ApplicationRouter) Notify(invokers
[]protocol.Invoker) {
logger.Error("Failed to notify a dynamically condition rule,
because url is empty")
return
}
+
+ dynamicConfiguration := conf.GetEnvInstance().GetDynamicConfiguration()
+ if dynamicConfiguration == nil {
+ logger.Infof("Config center does not start, Condition router
will not be enabled")
+ return
+ }
+
providerApplicaton := url.GetParam("application", "")
if providerApplicaton == "" || providerApplicaton ==
a.currentApplication {
logger.Warn("condition router get providerApplication is empty,
will not subscribe to provider app rules.")
@@ -181,12 +188,6 @@ func (a *ApplicationRouter) Notify(invokers
[]protocol.Invoker) {
defer a.mu.Unlock()
if providerApplicaton != a.application {
- dynamicConfiguration :=
conf.GetEnvInstance().GetDynamicConfiguration()
- if dynamicConfiguration == nil {
- logger.Warnf("config center does not start, please
check if the configuration center has been properly configured in dubbogo.yml")
- return
- }
-
if a.application != "" {
dynamicConfiguration.RemoveListener(strings.Join([]string{a.application,
constant.ConditionRouterRuleSuffix}, ""), a)
}
diff --git a/cluster/router/tag/router.go b/cluster/router/tag/router.go
index 3475d7f18..efe77aedd 100644
--- a/cluster/router/tag/router.go
+++ b/cluster/router/tag/router.go
@@ -84,7 +84,7 @@ func (p *PriorityRouter) Notify(invokers []protocol.Invoker) {
}
dynamicConfiguration := conf.GetEnvInstance().GetDynamicConfiguration()
if dynamicConfiguration == nil {
- logger.Warnf("config center does not start, please check if the
configuration center has been properly configured in dubbogo.yml")
+ logger.Infof("Config center does not start, Tag router will not
be enabled")
return
}
key := strings.Join([]string{application,
constant.TagRouterRuleSuffix}, "")