Skip to content

Latest commit

 

History

History

circuit-breaker

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

Circuit breaker patterns

Handle transient failures to improve application stability

ciruit-breaker

Examples

We have the following applications:

  • One app exposing a REST endpoint to fetch cats:
  • One gateway that transmits the requests to the cat service

Running the example

docker-compose up
# Call the url with the query parameter 'SUCCESS' to simulate a success query
curl -i -X POST http://localhost/cats?status=SUCCESS -d '{"name": "foo", "type": "bar"}'
# Call the url with the query parameter 'FAILURE' to simulate a failure query
curl -i -X POST http://localhost/cats?status=FAILURE -d '{"name": "foo", "type": "bar"}'
# Play with those queries and check the logs to check the application state on the circuit breaker

Sources