HealthIndicator with registry
See original GitHub issueEnhancement
Currently, in resilience4j-spring-boot2, HealthIndicator
is made with each CircuitBreaker
or RateLimiter
.
If make HealthIndicator
with Registry, it doesn’t need to add HealthIndicator
Singleton on each time CircuitBreaker
is created.
We can just return with CircuitBreakerRegistry.getAllCircuitBreakers()
.
public class CircuitBreakerHealthIndicator implements HealthIndicator {
private final CircuitBreakerRegistry circuitBreakerRegistry;
@Override
public Health health() {
return Optional.of(CircuitBreakerRegistry.getAllCircuitBreakers())
...;
}
}
With CompositeHealthIndicatorConfiguration
, there is no need to register to HealthIndicatorRegistry
manually. So it would be more easier to control HealthIndicator
.
Additionally, without org.springframework.boot:spring-boot-starter-actuator
, resilience4j-spring-boot2 cannot run. Error log is below.
Caused by: java.lang.ClassNotFoundException: org.springframework.boot.actuate.health.HealthIndicatorRegistry
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:583) ~[na:na]
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178) ~[na:na]
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521) ~[na:na]
... 48 common frames omitted
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:12 (12 by maintainers)
Top Results From Across the Web
HealthIndicatorRegistry (Spring Boot 2.3.12.RELEASE API)
Returns a snapshot of the registered health indicators and their names. void, register(String name, HealthIndicator healthIndicator). Deprecated. Registers the ...
Read more >Health Indicators in Spring Boot - Baeldung
In addition to the built-in ones, we can register custom HealthIndicators to report the health of a component or subsystem. In order to...
Read more >org.springframework.boot.actuate.health ... - Tabnine
public void addHealthIndicator(String name, HealthIndicator indicator) { this.registry.register(name, indicator);
Read more >Add and remove Spring Boot health checks dynamically
Whenever the health endpoint is queried, the registry is asked for a snapshot ... It could then call register(String, HealthIndicator) and ...
Read more >Spring Boot & Kubernetes - Cloud Native Tutorials
Health Check Actuator; Custom Health Indicator; Custom Configuration ... set the actuator dependencies, so we don't need to register them in the pom.xml...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks for your contributions.
Ok. I’ll make HealthIndicator with Registry.