|
|
@ -71,9 +71,7 @@ public class DynamicRouteScgFilter implements WebFilter, Ordered {
|
|
|
|
//Check whether the route has been loaded
|
|
|
|
//Check whether the route has been loaded
|
|
|
|
for(RouteDefinition routeDefinition: gatewayProperties.getRoutes()){
|
|
|
|
for(RouteDefinition routeDefinition: gatewayProperties.getRoutes()){
|
|
|
|
if (id.equals(routeDefinition.getId())){
|
|
|
|
if (id.equals(routeDefinition.getId())){
|
|
|
|
return webFilterChain.filter(serverWebExchange)
|
|
|
|
return webFilterChain.filter(serverWebExchange);
|
|
|
|
.doOnError(throwable -> LOG.error("handle DynamicRouteFilter[{}] error.", MetadataContextHolder.get(), throwable))
|
|
|
|
|
|
|
|
.doFinally((type) -> MetadataContextHolder.remove());
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -99,9 +97,7 @@ public class DynamicRouteScgFilter implements WebFilter, Ordered {
|
|
|
|
definition.setPredicates(Arrays.asList(predicate));
|
|
|
|
definition.setPredicates(Arrays.asList(predicate));
|
|
|
|
dynamicRouteService.add(definition);
|
|
|
|
dynamicRouteService.add(definition);
|
|
|
|
|
|
|
|
|
|
|
|
return webFilterChain.filter(serverWebExchange)
|
|
|
|
return webFilterChain.filter(serverWebExchange);
|
|
|
|
.doOnError(throwable -> LOG.error("handle DynamicRouteFilter[{}] error.", MetadataContextHolder.get(), throwable))
|
|
|
|
|
|
|
|
.doFinally((type) -> MetadataContextHolder.remove());
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|