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

* change RouteArgument.buildCustom to RouteArgument.fromLabel

* change RouteArgument.buildCustom to RouteArgument.fromLabel
pull/756/head
lepdou 2 years ago committed by GitHub
parent e4a288b056
commit 34d99fdf6a
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/727)
- [fix:fix discovery junit.](https://github.com/Tencent/spring-cloud-tencent/pull/729)
- [adapt polaris-java 1.10.1 version](https://github.com/Tencent/spring-cloud-tencent/pull/747)
- [Optimize: change RouteArgument.buildCustom to RouteArgument.fromLabel](https://github.com/Tencent/spring-cloud-tencent/pull/751)

@ -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);

@ -59,7 +59,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