What happens when communication between your REST APIs fails?
There is a pattern called Circuit Breaker that helps with these issues. This small project implements this pattern with the Resilience4j library in a Spring Boot project.
- Resilience4j: comes with an in-memory CircuitBreakerRegistry based on a ConcurrentHashMap which provides thread safety and atomicity guarantees.
- Spring boot: Makes it easy to create stand-alone, production-grade Spring based Applications that you can "just run".
- Prometheus: Prometheus is an open-source systems monitoring and alerting toolkit originally built at SoundCloud.
- Grafana: Grafana is the open source analytics & monitoring solution for every database.
# Runing product
cd product
mvn spring-boot:run
# Runing review
cd review
mvn spring-boot:run
- get all:
curl --location --request GET 'http://localhost:8801/products'
- get by id:
curl --location --request GET 'http://localhost:8801/products/1'
- get by product id:
curl --location --request GET 'http://localhost:8802/reviews/1'
- Import grafana dashboards:
- 4701 (JVM Micrometer metrics)
- 14430 (spring boot metrics)
- Resilience4j Dashboard