0

I've have a method which is annotated with @Scheduled and @Retryable. This method work fine with Mvc but the same method is not working on Webflux.

The scheduler works fine but Retryable is not happening. This happens only on Webflux.

 @Scheduled(cron = "${config.refresh.interval}")
 @Retryable(backoff = @Backoff(delayExpression = "${config.backoff.delay:999}"))
 public void refreshConfig() {

   // Load config values here

 }

Boot Version - 2.6.7 
spring-retry - 1.3.3
sea
  • 113
  • 8
  • A simple google search shows https://www.baeldung.com/spring-webflux-retry – Toerktumlare May 02 '22 at 20:39
  • Yes that's for WebClient and I'm aware of how to achieve the WebClient retry. The question is for a method retry which doesn't have WebClient usage at all. – sea May 02 '22 at 22:14
  • 1
    no its not for webclient, its for a `Mono` or `Flux` https://projectreactor.io/docs/core/release/api/reactor/core/publisher/Flux.html#retry-- retry annotation wont work, and without showing your actual usercase we cant show you how to implement it. You asked for how retryable is used in webflux and i have shown you. Stick your function in a producer using fromCallable, and then use retry. – Toerktumlare May 02 '22 at 22:29

0 Answers0