Hi team,

Version : Spring Boot WebFlux 2.2.5.RELEASE

Use Case

We consume lots of API from many external teams. Consequently, we want to manage a global Webclient logging to log the response from our API and sometimes, log and trigger specific actions on specific call.

The problem is that the global logging consume the client response and the specific trigger is never triggered.

Here is the global logging :

return clientResponse
                        .bodyToMono(String.class)
                        .doOnNext(responseBody -> {
                            log.error("[API][" + producers + "] Unsuccessful response received : {}", responseBody);
                        })
                        .then(Mono.just(clientResponse));

Here is the specific action we want to trigger on 404 response :

.onStatus(HttpStatus.NOT_FOUND::equals, clientResponse ->
                                clientResponse.bodyToMono(ErrorResponse.class)
                                        .flatMap(errorResponse -> Errors.SIMULATION_ERROR.equals(errorResponse.getCode()) ? Mono.error(SimulationErrorException::new) :
                                                Mono.error(new NotFoundException(id))))

Can you see something wrong ? Is it possible to consume both global and local ?

Comment From: rstoyanchev

Sorry for the slow response but can you provide a more complete snippet that includes both of the above snippets?

Comment From: spring-projects-issues

If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed.

Comment From: spring-projects-issues

Closing due to lack of requested feedback. If you would like us to look at this issue, please provide the requested information and we will re-open the issue.