Skip to content

Change readiness to liveness for default health check #46224

Answered by xstefank
stephan-strate asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @stephan-strate

you can use health registries for this but I don't think you can remove it from readiness. But you can add it to liveness like this:

@ApplicationScoped
public class StartObserver {

    @Inject
    @Readiness
    DataSourceHealthCheck healthCheck;

    public void observeStart(@Observes StartupEvent startupEvent) {
        HealthRegistries.getRegistry(HealthType.LIVENESS).register(healthCheck);
    }
}

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@stephan-strate
Comment options

@xstefank
Comment options

Answer selected by stephan-strate
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment