This is an automated email from the ASF dual-hosted git repository.
albumenj pushed a commit to branch 3.1
in repository https://gitbox.apache.org/repos/asf/dubbo.git
The following commit(s) were added to refs/heads/3.1 by this push:
new 9db2eb5a18 faq (#10542)
9db2eb5a18 is described below
commit 9db2eb5a1859b45ee4730350d7ef53b4c5ed6a87
Author: xin gu <[email protected]>
AuthorDate: Mon Sep 5 10:19:44 2022 +0800
faq (#10542)
* faq-meshroute
加载mesh路由规则失败
* Update MeshRuleRouter.java
fix ci/cd
---
.../rpc/cluster/router/mesh/route/MeshAppRuleListener.java | 10 +++++-----
.../dubbo/rpc/cluster/router/mesh/route/MeshRuleManager.java | 6 +++---
.../dubbo/rpc/cluster/router/mesh/route/MeshRuleRouter.java | 6 +++---
3 files changed, 11 insertions(+), 11 deletions(-)
diff --git
a/dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/router/mesh/route/MeshAppRuleListener.java
b/dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/router/mesh/route/MeshAppRuleListener.java
index ceb237ecd2..8116c0dfe2 100644
---
a/dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/router/mesh/route/MeshAppRuleListener.java
+++
b/dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/router/mesh/route/MeshAppRuleListener.java
@@ -20,7 +20,7 @@ package org.apache.dubbo.rpc.cluster.router.mesh.route;
import org.apache.dubbo.common.config.configcenter.ConfigChangeType;
import org.apache.dubbo.common.config.configcenter.ConfigChangedEvent;
import org.apache.dubbo.common.config.configcenter.ConfigurationListener;
-import org.apache.dubbo.common.logger.Logger;
+import org.apache.dubbo.common.logger.ErrorTypeAwareLogger;
import org.apache.dubbo.common.logger.LoggerFactory;
import org.apache.dubbo.common.utils.CollectionUtils;
import org.apache.dubbo.rpc.cluster.router.mesh.util.MeshRuleDispatcher;
@@ -43,7 +43,7 @@ import static
org.apache.dubbo.rpc.cluster.router.mesh.route.MeshRuleConstants.S
public class MeshAppRuleListener implements ConfigurationListener {
- public static final Logger logger =
LoggerFactory.getLogger(MeshAppRuleListener.class);
+ private static final ErrorTypeAwareLogger logger =
LoggerFactory.getErrorTypeAwareLogger(MeshAppRuleListener.class);
private final MeshRuleDispatcher meshRuleDispatcher;
@@ -78,17 +78,17 @@ public class MeshAppRuleListener implements
ConfigurationListener {
if (ruleType != null) {
groupMap.computeIfAbsent(ruleType, (k)-> new
LinkedList<>()).add(resultMap);
} else {
- logger.error("Unable to get rule type from raw rule. "
+
+ logger.error("2-13","receive mesh app route rule is
invalid","","Unable to get rule type from raw rule. " +
"Probably the metadata.name is absent. App Name: "
+ appName + " RawRule: " + configInfo);
}
} else {
- logger.error("Rule format is unacceptable. App Name: " +
appName + " RawRule: " + configInfo);
+ logger.error("2-13","receive mesh app route rule is
invalid","","Rule format is unacceptable. App Name: " + appName + " RawRule: "
+ configInfo);
}
}
ruleMapHolder = groupMap;
} catch (Exception e) {
- logger.error("[MeshAppRule] parse failed: " + configInfo, e);
+ logger.error("2-13","failed to receive mesh app route
rule","","[MeshAppRule] parse failed: " + configInfo,e);
}
if (ruleMapHolder != null) {
meshRuleDispatcher.post(ruleMapHolder);
diff --git
a/dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/router/mesh/route/MeshRuleManager.java
b/dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/router/mesh/route/MeshRuleManager.java
index e7d46b5542..8caa5b75ca 100644
---
a/dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/router/mesh/route/MeshRuleManager.java
+++
b/dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/router/mesh/route/MeshRuleManager.java
@@ -18,7 +18,7 @@
package org.apache.dubbo.rpc.cluster.router.mesh.route;
import org.apache.dubbo.common.config.configcenter.DynamicConfiguration;
-import org.apache.dubbo.common.logger.Logger;
+import org.apache.dubbo.common.logger.ErrorTypeAwareLogger;
import org.apache.dubbo.common.logger.LoggerFactory;
import org.apache.dubbo.rpc.cluster.governance.GovernanceRuleRepository;
import org.apache.dubbo.rpc.cluster.router.mesh.util.MeshRuleListener;
@@ -33,7 +33,7 @@ import static
org.apache.dubbo.rpc.cluster.router.mesh.route.MeshRuleConstants.M
public class MeshRuleManager {
- public static final Logger logger =
LoggerFactory.getLogger(MeshRuleManager.class);
+ private static final ErrorTypeAwareLogger logger =
LoggerFactory.getErrorTypeAwareLogger(MeshRuleManager.class);
private final ConcurrentHashMap<String, MeshAppRuleListener>
APP_RULE_LISTENERS = new ConcurrentHashMap<>();
@@ -63,7 +63,7 @@ public class MeshRuleManager {
meshAppRuleListener.receiveConfigInfo(rawConfig);
}
} catch (Throwable throwable) {
- logger.error("get MeshRuleManager app rule failed.", throwable);
+ logger.error("2-13","failed to get mesh app route rule","","get
MeshRuleManager app rule failed.",throwable);
}
ruleRepository.addListener(appRuleDataId,
DynamicConfiguration.DEFAULT_GROUP, meshAppRuleListener);
diff --git
a/dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/router/mesh/route/MeshRuleRouter.java
b/dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/router/mesh/route/MeshRuleRouter.java
index 105332e9b7..2469c3a758 100644
---
a/dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/router/mesh/route/MeshRuleRouter.java
+++
b/dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/router/mesh/route/MeshRuleRouter.java
@@ -17,7 +17,7 @@
package org.apache.dubbo.rpc.cluster.router.mesh.route;
import org.apache.dubbo.common.URL;
-import org.apache.dubbo.common.logger.Logger;
+import org.apache.dubbo.common.logger.ErrorTypeAwareLogger;
import org.apache.dubbo.common.logger.LoggerFactory;
import org.apache.dubbo.common.utils.CollectionUtils;
import org.apache.dubbo.common.utils.Holder;
@@ -58,7 +58,7 @@ import static
org.apache.dubbo.rpc.cluster.router.mesh.route.MeshRuleConstants.V
public abstract class MeshRuleRouter<T> extends AbstractStateRouter<T>
implements MeshRuleListener {
- public static final Logger logger =
LoggerFactory.getLogger(MeshRuleRouter.class);
+ private static final ErrorTypeAwareLogger logger =
LoggerFactory.getErrorTypeAwareLogger(MeshRuleRouter.class);
private final Map<String, String> sourcesLabels;
private volatile BitList<Invoker<T>> invokerList = BitList.emptyList();
@@ -308,7 +308,7 @@ public abstract class MeshRuleRouter<T> extends
AbstractStateRouter<T> implement
appToVDGroup.put(appName, vsDestinationGroup);
}
} catch (Throwable t) {
- logger.error("Error occurred when parsing rule component.", t);
+ logger.error("2-13","failed to parse mesh route rule","","Error
occurred when parsing rule component.",t);
}
computeSubset(appToVDGroup);