Retry failed HTTP calls with RxJS
In this recipe, you're going to learn how to retry HTTP calls smartly with RxJS operators. We're going to use a technique called Exponential Backoff
technique. Which means that we retry the http calls but with each next call having a delay more than the previous time for the attempt. And we stop after a number of maximum tries. Sounds exciting? Let's get into it
Getting ready
The app that we are going to work with resides in start/apps/chapter05/rx-retry-http-calls
inside the cloned repository:
- Open the code repository in your Code Editor.
- Open the terminal, navigate to the code repository directory and run
npm run serve rx-retry-http-calls with-server
to serve the project with the backend server
This should open the app in a new browser tab and you should see the following:
Let's jump into the recipe steps in the next section.