fixes(gh-3974): Invalid shortcut field order configuration in circuitbreaker filter factory#3975
Conversation
…n in circuit breaker filter factory
| @Override | ||
| public List<String> shortcutFieldOrder() { | ||
| return singletonList(NAME_KEY); | ||
| return Arrays.asList(NAME_KEY, FALLBACK_URI_KEY, ROUTE_ID_KEY, STATUS_CODES_KEY, RESUME_WITHOUT_ERROR_KEY); |
There was a problem hiding this comment.
I don't think this will work. RouteId should be set dynamically, not by a usewr. status codes is a set. I think if you need all these things, you shouldn't use the shortcut.
There was a problem hiding this comment.
Hi Spencer,
Thank you for the feedback. Based on your points, it makes sense to exclude routeId from the shortcutFieldOrder() method since it should indeed be set dynamically and not by the user configuration.
To align with this, I suggest the following adjustment to only include parameters suitable for shortcut usage and remove the routeId
@Override
public List<String> shortcutFieldOrder() {
return Arrays.asList(NAME_KEY, FALLBACK_URI_KEY, STATUS_CODES_KEY, RESUME_WITHOUT_ERROR_KEY);
}
That would work?
There was a problem hiding this comment.
Again, statusCodes is a set and will not work in combination with others as a shortcut.
|
Why not use the long form configuration? |
I will re-check how we are generating parameters from database, maybe we are using generated names and should move to named parameters. |
I've added all parameters to shortcut field order for CB.
Fixes #3974