Skip to content

Commit

Permalink
支持同时多个DiscoveryEnabledStrategy的联合判断;支持网关动态选择子环境的功能;修复子环境过滤为判断元数据中的env…
Browse files Browse the repository at this point in the history
…为空的Bug
  • Loading branch information
HaojunRen committed Jan 1, 2020
1 parent 005670c commit 23179d6
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,10 @@ public void opentracingHeader(Map<String, String> customizationMap) {
if (StringUtils.isNotEmpty(routeAddress)) {
span.setTag(DiscoveryConstant.N_D_ADDRESS, routeAddress);
}
String routeEnvironment = strategyContextHolder.getHeader(DiscoveryConstant.N_D_ENVIRONMENT);
if (StringUtils.isNotEmpty(routeEnvironment)) {
span.setTag(DiscoveryConstant.N_D_ENVIRONMENT, routeEnvironment);
}
String routeVersionWeight = strategyContextHolder.getHeader(DiscoveryConstant.N_D_VERSION_WEIGHT);
if (StringUtils.isNotEmpty(routeVersionWeight)) {
span.setTag(DiscoveryConstant.N_D_VERSION_WEIGHT, routeVersionWeight);
Expand Down Expand Up @@ -170,6 +174,10 @@ public void opentracingLocal(String className, String methodName, Map<String, St
if (StringUtils.isNotEmpty(routeAddress)) {
span.setTag(DiscoveryConstant.N_D_ADDRESS, routeAddress);
}
String routeEnvironment = strategyContextHolder.getHeader(DiscoveryConstant.N_D_ENVIRONMENT);
if (StringUtils.isNotEmpty(routeEnvironment)) {
span.setTag(DiscoveryConstant.N_D_ENVIRONMENT, routeEnvironment);
}
String routeVersionWeight = strategyContextHolder.getHeader(DiscoveryConstant.N_D_VERSION_WEIGHT);
if (StringUtils.isNotEmpty(routeVersionWeight)) {
span.setTag(DiscoveryConstant.N_D_VERSION_WEIGHT, routeVersionWeight);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,10 @@ public void debugHeader() {
if (StringUtils.isNotEmpty(routeAddress)) {
System.out.println(DiscoveryConstant.N_D_ADDRESS + "=" + routeAddress);
}
String routeEnvironment = strategyContextHolder.getHeader(DiscoveryConstant.N_D_ENVIRONMENT);
if (StringUtils.isNotEmpty(routeEnvironment)) {
System.out.println(DiscoveryConstant.N_D_ENVIRONMENT + "=" + routeEnvironment);
}
String routeVersionWeight = strategyContextHolder.getHeader(DiscoveryConstant.N_D_VERSION_WEIGHT);
if (StringUtils.isNotEmpty(routeVersionWeight)) {
System.out.println(DiscoveryConstant.N_D_VERSION_WEIGHT + "=" + routeVersionWeight);
Expand Down Expand Up @@ -188,6 +192,10 @@ public void debugLocal() {
if (StringUtils.isNotEmpty(routeAddress)) {
System.out.println(DiscoveryConstant.N_D_ADDRESS + "=" + routeAddress);
}
String routeEnvironment = strategyContextHolder.getHeader(DiscoveryConstant.N_D_ENVIRONMENT);
if (StringUtils.isNotEmpty(routeEnvironment)) {
System.out.println(DiscoveryConstant.N_D_ENVIRONMENT + "=" + routeEnvironment);
}
String routeVersionWeight = strategyContextHolder.getHeader(DiscoveryConstant.N_D_VERSION_WEIGHT);
if (StringUtils.isNotEmpty(routeVersionWeight)) {
System.out.println(DiscoveryConstant.N_D_VERSION_WEIGHT + "=" + routeVersionWeight);
Expand Down

0 comments on commit 23179d6

Please sign in to comment.