/circuit-breaker

Java application using circuit breaker with resilience4j

Primary LanguageJava

💻 Project

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.

✨ Technologies

  • 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.

🚀 How to execute

# Runing product
cd product
mvn spring-boot:run

# Runing review
cd review
mvn spring-boot:run

✨ How to use

Product endpoints

  • get all:
curl --location --request GET 'http://localhost:8801/products'
  • get by id:
curl --location --request GET 'http://localhost:8801/products/1'

Review endpoints

  • get by product id:
curl --location --request GET 'http://localhost:8802/reviews/1'

📊 Metrics Dashboard