In traditional Spring MVC filter I can add some code after chain.doFilter so that they will executed at the very end. For example:
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) {
chain.doFilter(request, response);
A();
}
The function A will be executed at the very end after all filters and controllers are executed, even after onBeforeCommitResponse is invoked.
I want to do this same in WebFlux WebFilter.
public Mono<Void> filter(ServerWebExchange exchange, WebFilterChain chain) {
return chain.filter(exchange);
// Call A() after all filters, controllers and after beforeCommit
}
How do I achieve this?