The speakers service should be able to unregister itself on shutdown. In this video, learn how to implement this.
- [Instructor] We want to unregister services … when they are terminated. … Detecting program exits in Node.js … isn't as easy as one might think … and there are also differences from operating system … to operating system. … In real life environments, you will have to have … a closer look on how your services … are started and stopped and register the right handler … for the deuce case … but I will show you now a way … that should at least should catch the most common ways … a Node.js process could exit. … Remember, if a service fails to unregister itself … we still have the timer in place. … First, let's create an unregister function. … First, I again open bin, run in the SPEAKERS-SERVICE … and there I'm now adding an unregister function, … so it's similar to registerService, … I copy, paste it and let's call it unregister … and the only difference to the register call … is I will now use delete as HTTP verb. … Next, I want to create a function … that actually does the cleanup. … So, for that I add right after I have the setInterval, …
- 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.