You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Though I fixed the documentation in #2733 I am still unable to use the rate limiter in Discovery. It appears that in the code you're assembling a new evaluation context containing only the metadata and not include the rest of the context so defining a keyresolver does not work inside discovery
In DiscoveryClientRouteDefinitionLocator specifically
private DiscoveryClientRouteDefinitionLocator(String discoveryClientName, DiscoveryLocatorProperties properties) {
this.properties = properties;
if (StringUtils.hasText(properties.getRouteIdPrefix())) {
routeIdPrefix = properties.getRouteIdPrefix();
}
else {
routeIdPrefix = discoveryClientName + "_";
}
// context is built here
evalCtxt = SimpleEvaluationContext.forReadOnlyDataBinding().withInstanceMethods().build();
}
// and only gets the info from the service instance.
String getValueFromExpr(SimpleEvaluationContext evalCtxt, SpelExpressionParser parser, ServiceInstance instance,
Map.Entry<String, String> entry) {
try {
Expression valueExpr = parser.parseExpression(entry.getValue());
return valueExpr.getValue(evalCtxt, instance, String.class);
}
catch (ParseException | EvaluationException e) {
if (log.isDebugEnabled()) {
log.debug("Unable to parse " + entry.getValue(), e);
}
throw e;
}
}
Sample
If possible, please provide a test case or sample application that reproduces
the problem. This makes it much easier for us to diagnose the problem and to verify that
we have fixed it.
The text was updated successfully, but these errors were encountered:
Describe the bug
Though I fixed the documentation in #2733 I am still unable to use the rate limiter in Discovery. It appears that in the code you're assembling a new evaluation context containing only the metadata and not include the rest of the context so defining a keyresolver does not work inside discovery
In DiscoveryClientRouteDefinitionLocator specifically
Sample
If possible, please provide a test case or sample application that reproduces
the problem. This makes it much easier for us to diagnose the problem and to verify that
we have fixed it.
The text was updated successfully, but these errors were encountered: