Hello team,

When I use Webclient to call a non-existent URI and an 404 error occurs, block() and retryWhen() will asynchronously capture the error signal, causing my controller to return immediately. At the same time, there is an asynchronous thread executing the retry logic.

Before the retry logic is completed, block() captures the error signal.

What I expect is block() catches the error signal and then return after my retry logic is executed, just as version 3.2.2. There's no such problem when i use version 3.2.2.

You can see details and code in https://github.com/spring-projects/spring-framework/issues/33567.

I was advised not to use block() in above link.

However, my project is a servlet application. If I want the HTTP response to not be a Flux or Mono, which client should I use to perform HTTP requests? It seems that RestTemplate will be deprecated in a future version and WebClient is a replacement. I used WebClient.block() to get objects before, but encountered some issues mentioned earlier. Do you have any suggestions?

Best Regards

Comment From: bclozel

Duplicates #33567 - I'll answer your comments there.