Answer the question
In order to leave comments, you need to log in
What are some good practices for automating the retry of failed actions?
How to automate the repetition of an action on all sorts of different fails, for example, the base is not available, the one-way API is not available, or the second, or some other component?
I don't have a specific example of a problem that needs to be solved, but I think that many people have examples from life when they solved similar problems. Interested in both your stories and generally accepted practices, if any. I'm asking this question purely for academic purposes.
Answer the question
In order to leave comments, you need to log in
I have a synchronizer site<>1C. once a day, the site goes to 1C and pulls a bunch of stuff. if one of the requests fell, then the attempt goes N more times, if all the times there were errors, then the application crashes. Nothing tricky.
usually, to implement retries in case of unsuccessful operation, the Retryer pattern is used
The Actor Model is well suited to work in such conditions. Its important part is the concept of supervision. Child actor - "worker" - implements risky logic. If he fell - the supervisor decides what to do next. Among the standard patterns there is, for example, ExponentialBackoff: the pause between attempts increases until a certain value (for example, 5 minutes) or a limit on the number of attempts is reached.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question