Skip to content
Advertisement

How to avoid hardcode in every class WebClient retryWhen

I want to implement retry mechanism and I did something like this:

JavaScript

And used this method here:

JavaScript

But I want to create a generic one to use it across all application to not write first method in all classes, how can I do this more efficiently?

Advertisement

Answer

The way that I decided to implement this is as follows:

JavaScript

And called it in retryWhen:

JavaScript
User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement