Repository has these applications;
/eureka
-> Use the Service Registry to dynamically discover and call registered services. Developed by Netflix.
/hystrix-dashboard
-> A latency and fault tolerance library. Developed by Netflix.
/custom-sample-api
-> Provides sample data and registered toeureka
. Can be called any application which fetchs registered services from it ashttp://remote-service
.
/custom-sample-ui
-> Circuit breaker pattern is implemented. All metrics can be discovered with Hystrix Dashboard. It callscustom-sample-api
.
- JDK 1.8
- Apache Maven 3.5.4
- dotnet 2.1
cd /eureka
mvn -N io.takari:maven:wrapper
./mvnw spring-boot:run
cd /hystrix-dashboard
mvn install
java -jar target/hystrix-dashboard-0.0.1.BUILD-SNAPSHOT.jar
cd /custom-sample-api
dotnet run
cd /custom-sample-ui
dotnet run
Start UI application and run while true; do sleep 1; curl -s http://localhost:1923/api/home;echo -e '\r';done
on terminal. Note: API is not running yet!
After executes less than 10 requests (circuitBreaker:RequestVolumeThreshold, default to 20) in 10 seconds (metrics:rollingStats:timeInMilliseconds, default to 10000 seconds), there won't be any decision to change the status. If fulfills the minimum threshold requirement and more than 80% of requests have failed (circuitBreaker:errorThresholdPercentage, default to 50), Hystrix will decide to open the Circuit Breaker.
When you see
Circuit Open
message on http://localhost:7979/hystrix/monitor?stream=http://localhost:1923/hystrix/hystrix.stream
run the API immediately and wait until status changes!