Monitoring circuits
Okay, we've coded up a command with a circuit breaker, and given it a fallback command in the event the remote service is down. But how can we monitor it? Simply put--how can we detect if the circuit is open or closed?
Introducing the Hystrix Dashboard. With just a smidgeon of code, we can have another Spring Boot application provide us with a graphical view of things. And from there, we can test out what happens if we put the system under load, and then break the system.
To build the app, we first need to visit http://start.spring.io, and select Hystrix Dashboard
and Turbine
. If we also select Gradle
and Spring Boot 2.0.0
, and enter in our similar artifact details, we can produce another app. (Notice how handy it is to simply let everything be a Spring Boot app?)
The build file is the same except for these dependency settings:
buildscript { ext { springBootVersion = '2.0.0.M5' springCloudVersion = 'Finchley.M3' } ... } ...