title: Looking for an alternative of retryWhen which is now Deprecated
body: <p>I'm facing an issue with <code>WebClient</code> and <code>reactor-extra</code>. Indeed, I have the following method :</p>
  
  <pre><code>public Employee getEmployee(String employeeId) {
              return webClient.get()
                      .uri(FIND_EMPLOYEE_BY_ID_URL, employeeId)
                      .retrieve()
                      .onStatus(HttpStatus.NOT_FOUND::equals, clientResponse -&gt; Mono.empty())
                      .onStatus(HttpStatus::is5xxServerError, clientResponse -&gt; Mono.error(new MyCustomException("Something went wrong calling getEmployeeById")))
                      .bodyToMono(Employee.class)
                      .retryWhen(Retry.onlyIf(ConnectTimeoutException.class)
                               .fixedBackoff(Duration.ofSeconds(10))
                               .retryMax(3))
                      .block();
      }
  </code></pre>
  
  <p>I've found that I could use <code>retryWhen(Retry.onlyIf(...))</code> because I want to retry only if a <code>ConnectTimeoutException</code> is thrown. I've found this solution from this post : <a href="https://stackoverflow.com/questions/58520919/spring-webclient-retry-with-backoff-on-specific-error">spring webclient: retry with backoff on specific error</a></p>
  
  <p>But, in the latest version of <code>reactor</code> the following method became deprecated :</p>
  
  <p><code>public final Mono&lt;T&gt; retryWhen(Function&lt;Flux&lt;Throwable&gt;, ? extends Publisher&lt;?&gt;&gt; whenFactory)</code></p>
  
  <p>After hours of googling I haven't found any solution to this question : Is there any alternative for <code>retryWhen</code> and <code>Retry.onlyIf</code> with the latest versions of <code>reactor</code></p>
  
  <p>Thanks for your help !</p>