'Ordering multiple HandlerFilterfunction in SpringWebflux
If I have multiple HandlerFilterFunctions in my route config, how do I guarantee the order of their execution? In the code below, how does one ensure that FilterA is called before FilterB?
public class RouterConfig {
@Bean
public RouterFunction<ServerResponse> route(MyHandler myHandler) {
return RouterFunctions
.route(RequestPredicates.GET("/some/route")
.and(RequestPredicates.accept(MediaType.APPLICATION_JSON)), myHandler::getMyResponse)
.filter(new FilterA())
.filter(new FilterB())
}
}
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|