Support for multiple HealthChecks that resolve to a single health check status #117
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The current Karyon and Eureka health check implementation attempts to consolidate multiple health states into a single status in a way that uses unwieldy dependencies between various conditions for health check. This PR provides a generic solution through which multiple HealthCheck components may be registered and resolved into a single strategy using a plugable strategy.
Several new concepts are introduced here,
(isReady=false, error=null) Component is initializing
(isReady=false, error=nonnull) Component failed to initialize
(isReady=true, error=null) Component has been initialized and is working properly
Note that this implementation depends on a (yet to be issued) update to eureka where ApplicationInfoManager tracks an InstanceStatus separately instead of setting that status directly on the singleton InstanceInfo. This solves various race conditions whereby the InstanceInfo status can be updated independently outside of the context of healthcheck.
An example use case for this mechanism is to track an application's healthcheck using 3 conditions.
All 3 conditions must be set to a healthy status for an InstanceInfo.UP status to be set on the eureka client