You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dubbo.apache.org by ra...@apache.org on 2021/12/24 07:18:41 UTC
[dubbo-admin] branch develop updated: 修复更新,删除service类型的条件路由异常的问题 (#861)
This is an automated email from the ASF dual-hosted git repository.
ranke pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/dubbo-admin.git
The following commit(s) were added to refs/heads/develop by this push:
new df24d39 修复更新,删除service类型的条件路由异常的问题 (#861)
df24d39 is described below
commit df24d399cc309e21f411ef8aebb8dc5606bc275c
Author: ymybxx <77...@qq.com>
AuthorDate: Fri Dec 24 15:15:49 2021 +0800
修复更新,删除service类型的条件路由异常的问题 (#861)
---
.../main/java/org/apache/dubbo/admin/service/impl/RouteServiceImpl.java | 2 ++
1 file changed, 2 insertions(+)
diff --git a/dubbo-admin-server/src/main/java/org/apache/dubbo/admin/service/impl/RouteServiceImpl.java b/dubbo-admin-server/src/main/java/org/apache/dubbo/admin/service/impl/RouteServiceImpl.java
index 4856a5f..e15375e 100644
--- a/dubbo-admin-server/src/main/java/org/apache/dubbo/admin/service/impl/RouteServiceImpl.java
+++ b/dubbo-admin-server/src/main/java/org/apache/dubbo/admin/service/impl/RouteServiceImpl.java
@@ -77,6 +77,7 @@ public class RouteServiceImpl extends AbstractService implements RouteService {
//for 2.6
if (StringUtils.isNotEmpty(newConditionRoute.getService())) {
for (Route old : convertRouteToOldRoute(oldConditionRoute)) {
+ old.setService(id);
registry.unregister(old.toUrl().addParameter(Constants.COMPATIBLE_CONFIG, true));
}
for (Route updated : convertRouteToOldRoute(newConditionRoute)) {
@@ -101,6 +102,7 @@ public class RouteServiceImpl extends AbstractService implements RouteService {
RoutingRule originRule = YamlParser.loadObject(config, RoutingRule.class);
ConditionRouteDTO conditionRouteDTO = RouteUtils.createConditionRouteFromRule(originRule);
for (Route old : convertRouteToOldRoute(conditionRouteDTO)) {
+ old.setService(id);
URL oldUrl = old.toUrl();
if(oldUrl.getParameter("rule").contains("host") && oldUrl.getParameter("rule").contains("false")) {
registry.unregister(oldUrl);