O'Reilly logo

TypeScript Microservices by Parth Ghiya

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Why HTTP code is vital in microservices?

Microservices are fully distributed and constantly moving. Therefore, without any standard means of communication, we won't be able to trigger the corresponding fail-safe measure. For instance, if we implement the circuit breaker pattern, the circuit should know that whenever it receives the 5xx series of code, it should keep the circuit open as the server is unavailable. Similarly, if it received 429, then it should block the request from that particular client. The complete microservice ecosystem includes proxies, caches, RPCs, and other services for which HTTP is the common language. Based on the aforementioned code, they can take appropriate action accordingly.

In the next section, we will learn ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required