change RouteArgument.buildCustom to RouteArgument.fromLabel (#750)

* change RouteArgument.buildCustom to RouteArgument.fromLabel

* change RouteArgument.buildCustom to RouteArgument.fromLabel
pull/752/head
lepdou 2 years ago committed by GitHub
parent f5fec381cc
commit 2a67279fec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -13,3 +13,4 @@
- [fix:fix javadoc.](https://github.com/Tencent/spring-cloud-tencent/pull/726)
- [fix:fix discovery junit.](https://github.com/Tencent/spring-cloud-tencent/pull/728)
- [adapt polaris-java 1.10.1 version](https://github.com/Tencent/spring-cloud-tencent/pull/748)
- [Optimize: change RouteArgument.buildCustom to RouteArgument.fromLabel](https://github.com/Tencent/spring-cloud-tencent/pull/750)

@ -60,7 +60,7 @@ public class MetadataRouterRequestInterceptor implements RouterRequestIntercepto
Set<RouteArgument> routeArguments = new HashSet<>();
if (!CollectionUtils.isEmpty(metadataRouterKeys)) {
for (Map.Entry<String, String> entry : metadataRouterLabels.entrySet()) {
routeArguments.add(RouteArgument.buildCustom(entry.getKey(), entry.getValue()));
routeArguments.add(RouteArgument.fromLabel(entry.getKey(), entry.getValue()));
}
}
request.putRouterArgument(MetadataRouter.ROUTER_TYPE_METADATA, routeArguments);

@ -58,7 +58,7 @@ public class RuleBasedRouterRequestInterceptor implements RouterRequestIntercept
Map<String, String> ruleRouterLabels = routerContext.getLabels(RouterConstant.ROUTER_LABELS);
if (!CollectionUtils.isEmpty(ruleRouterLabels)) {
for (Map.Entry<String, String> label : ruleRouterLabels.entrySet()) {
routeArguments.add(RouteArgument.buildCustom(label.getKey(), label.getValue()));
routeArguments.add(RouteArgument.fromLabel(label.getKey(), label.getValue()));
}
}
}

Loading…
Cancel
Save