In this video, learn how to query the registry from a route.
- [Instructor] I'm back in my service registry. … And of course there's a module for pausing … and comparing semver strings. … And let's install it by running npm install --save semver. … Next I will open ServiceRegistry.js. … And on top of it I just add const semver … equals require semver. … Now I have to add this method that gets a service … given a name and a version. … I simply call get(name, version). … And I now want to filter the services … and find those that match my criteria. … So I add const candidates equals object.values. … So this will give me the individual entries … of this.services. … And on each of those entries, I call filter. … And this filter function gets the service in its callback. … And this is an ES6 shortcut syntax now … where I simply do service.name equals name. … So I'm comparing is this a service with the right name? … And if so, I compare semver.satisfies service.version … with the requested version. … As mentioned before, I also want to add some randomness …
- 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.