In this video, learn how to build a fully featured circuit breaker with Node.js.
- [Instructor] We will build the circuit breaker … directly into our conference-app. … Depending on use case, and preferences, … it could also live inside the service registry … or even be a service on its own. … So, in my conference-app, I will now go to server … and there I create a new folder lib, … and in there, I create new file CircuitBreaker.js, … and in there let's start with the class declaration … and let's also not forget to module.exports that. … So first of all, … the circuit breaker will have to do up on http calls, … so we will bring in axios, const axios … equals require axios at the very top … of this file. … Now let's start with the constructor, … where we will initialize a few member variables … that we will need. … First I want to store individual state … for each end point that we are calling. … So I want to create some member … that can hold all these states. … So I add this.states equals … and it's an empty object. … I want the circuit to be open … after a certain threshold of failures, …
- Setting up a service registry
- Registering and deregistering services
- Versioning and load balancing
- Adding the service logic
- Working with the circuit breaker
- Using queues
- Consuming and storing feedback
Skill Level Intermediate
Node.js: Debugging and Performance Tuningwith Jon Peck2h 44m Intermediate
1. Get started with Microservices
2. Creating a Service Registry
3. Splitting Up a Monolith into Microservices
4. Adding Fault Tolerance and Resilience
5. Using Queues with Node.js
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.