We have situation and architecture looks like below.
RabbitMQQueue -> Spring Boot RabbitMQ Listener -> Service Layer -> (Network call).
In above network call depends on the URL sent in each message from the queue.
Now many times this network calls fails as its external servers with 429 error code.
Remember above are so many different URLS and its comming from a single Queue.
We implemented the retry using spring retry and we have seen improvements but as the scale and the number of requests are too high
We need to do some improvement in the retry
Currently retry is implemented with fixed back off and max attempts as 3
I am thinking of using the retry-after which means in each retry to network call I need to have the different backoffpolicy
Is this viable and correct approach or is there any improvement can be done at any level?
Can we have separate backoffpolicy for each retry which will be performed
Please suggest if this can be achieved by spring retry