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

* change RouteArgument.buildCustom to RouteArgument.fromLabel

* add change log
pull/764/head
lepdou 2 years ago committed by GitHub
parent e57c9a1306
commit 26b7e3d1c3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -17,3 +17,4 @@
- [Code optimization & correct comment](https://github.com/Tencent/spring-cloud-tencent/pull/722)
- [fix:fix discovery junit.](https://github.com/Tencent/spring-cloud-tencent/pull/730)
- [adapt polaris-java 1.10.1 version](https://github.com/Tencent/spring-cloud-tencent/pull/746)
- [Optimize: change RouteArgument.buildCustom to RouteArgument.fromLabel](https://github.com/Tencent/spring-cloud-tencent/pull/749)

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