Grokking Microservices Design Patterns
0% completed
Retry Pattern: An Example
A retry policy answers three questions, and each one can be got wrong on its own.
- Is this failure worth retrying? A timeout might pass next time. A rejected request will be rejected again just as fast.
- How long should we wait? Long enough for the fault to clear, and not so long that the caller gives up first.
- When do we stop? Every policy needs a limit, or a broken dependency is retried until something else breaks.
The code below runs a policy against a service that answers from a rule. The same run comes out the same way every time.
.....
.....
.....
Like the course? Get enrolled and start learning!
Reading Progress
0%