> For the complete documentation index, see [llms.txt](https://petercheng7788.gitbook.io/developer-note/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://petercheng7788.gitbook.io/developer-note/backend/microservice/circuit-breaker.md).

# Circuit Breaker

* If the large of request to microservice, and the percentage of getting failure response is over the limit, the response will be directly return fallback response without triggering the function of the microservice

![](https://1374779285-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MFW3x2aqEO8GF2kr3VU%2F-MXKrvLoWemAkoC_gca2%2F-MXLlMqRDowByICaNs7O%2Fimage.png?alt=media\&token=36da5521-0da4-4355-a177-7e122d544706)

* Closed: Take all the request into function and return the response, if number of percentage of response is fallback response, it will switch to open state
* Open:  Stop accepting the request for few moment and switch back to half open state
* Half open : Take certain percentage of request to see whether the microservice run properly or not, if yes, switch to close state , else switch back to open state
