Class CompositeReactiveHealthIndicator
- java.lang.Object
- org.springframework.boot.actuate.health.CompositeReactiveHealthIndicator
- All Implemented Interfaces:
ReactiveHealthIndicator
public class CompositeReactiveHealthIndicator extends Object implements ReactiveHealthIndicator
ReactiveHealthIndicator
that returns health indications from all registered delegates. Provides an alternativeHealth
for a delegate that reaches a configurable timeout.- Since:
- 2.0.0
Constructor Summary
Constructors Constructor Description CompositeReactiveHealthIndicator(HealthAggregator healthAggregator)
Deprecated.since 2.1.0 in favor ofCompositeReactiveHealthIndicator(HealthAggregator, ReactiveHealthIndicatorRegistry)
CompositeReactiveHealthIndicator(HealthAggregator healthAggregator, Map<String,ReactiveHealthIndicator> indicators)
Deprecated.since 2.1.0 in favor ofCompositeReactiveHealthIndicator(HealthAggregator, ReactiveHealthIndicatorRegistry)
CompositeReactiveHealthIndicator(HealthAggregator healthAggregator, ReactiveHealthIndicatorRegistry registry)
Create a newCompositeReactiveHealthIndicator
from the indicators in the givenregistry
.
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description CompositeReactiveHealthIndicator
addHealthIndicator(String name, ReactiveHealthIndicator indicator)
Deprecated.since 2.1.0 in favor ofReactiveHealthIndicatorRegistry.register(String, ReactiveHealthIndicator)
reactor.core.publisher.Mono<Health>
health()
Provide the indicator of health.CompositeReactiveHealthIndicator
timeoutStrategy(long timeout, Health timeoutHealth)
Constructor Detail
CompositeReactiveHealthIndicator
@Deprecated public CompositeReactiveHealthIndicator(HealthAggregator healthAggregator)
Deprecated.since 2.1.0 in favor ofCompositeReactiveHealthIndicator(HealthAggregator, ReactiveHealthIndicatorRegistry)
Create a newCompositeReactiveHealthIndicator
.- Parameters:
healthAggregator
- the health aggregator
CompositeReactiveHealthIndicator
@Deprecated public CompositeReactiveHealthIndicator(HealthAggregator healthAggregator, Map<String,ReactiveHealthIndicator> indicators)
Deprecated.since 2.1.0 in favor ofCompositeReactiveHealthIndicator(HealthAggregator, ReactiveHealthIndicatorRegistry)
Create a newCompositeReactiveHealthIndicator
from the specified indicators.- Parameters:
healthAggregator
- the health aggregatorindicators
- a map ofHealthIndicators
with the key being used as an indicator name.
CompositeReactiveHealthIndicator
public CompositeReactiveHealthIndicator(HealthAggregator healthAggregator, ReactiveHealthIndicatorRegistry registry)
Create a newCompositeReactiveHealthIndicator
from the indicators in the givenregistry
.- Parameters:
healthAggregator
- the health aggregatorregistry
- the registry ofHealthIndicators
.
Method Detail
addHealthIndicator
@Deprecated public CompositeReactiveHealthIndicator addHealthIndicator(String name, ReactiveHealthIndicator indicator)
Deprecated.since 2.1.0 in favor ofReactiveHealthIndicatorRegistry.register(String, ReactiveHealthIndicator)
Add aReactiveHealthIndicator
with the specified name.- Parameters:
name
- the name of the health indicatorindicator
- the health indicator to add- Returns:
- this instance
- Throws:
IllegalStateException
- if an indicator with the givenname
is already registered.
timeoutStrategy
public CompositeReactiveHealthIndicator timeoutStrategy(long timeout, Health timeoutHealth)
- Parameters:
timeout
- number of milliseconds to wait before using thetimeoutHealth
timeoutHealth
- theHealth
to use if an health indicator reached thetimeout
- Returns:
- this instance
health
public reactor.core.publisher.Mono<Health> health()
Description copied from interface:ReactiveHealthIndicator
Provide the indicator of health.- Specified by:
health
in interfaceReactiveHealthIndicator
- Returns:
- a
Mono
that provides theHealth