Grokking Microservices Design Patterns
0% completed
Retry Pattern: An Example
A retry policy answers three questions, and each one can be answered wrongly on its own.
- Is this failure worth retrying? The cause of a timeout might be gone 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 according to a fixed rule. The same run comes out the same way every time
.....
.....
.....
Like the course? Get enrolled and start learning!
Reading Progress
0%