'Performance of WebFlux with retry exponential backoff

I'm building a webhook service that sends events to client's URLs. In case of failure or timeout, I need to retry the sending with with exponential backoff. I've two ways to implement the logic:

  1. Using WebClient's internal retry feature:
WebClient.create()
    .post()
    .uri(URL)
    .exchange()
    ...
    .retryWhen(Retry.backoff(4, Duration.ofSeconds(3)).jitter(0.7));
  1. Another way is using rabbitMQ deadLetterExchange to re-queue the message with exponential backoof as mentioned here: https://www.baeldung.com/spring-amqp-exponential-backoff

Applying WebFlux internal retry feature is easy for development but I've some concerns over using it because messages are stored in application memory and it may affect the performance when the number of messages are high. I want to know other developers thoughts on these options. Also, is there any better options?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source