All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.smallrye.reactive.messaging.extension.health.SmallRyeReactiveMessagingReadinessCheck Maven / Gradle / Ivy

The newest version!
package io.smallrye.reactive.messaging.extension.health;

import jakarta.enterprise.context.ApplicationScoped;
import jakarta.inject.Inject;

import org.eclipse.microprofile.health.HealthCheck;
import org.eclipse.microprofile.health.HealthCheckResponse;
import org.eclipse.microprofile.health.Readiness;

import io.smallrye.reactive.messaging.health.HealthReport;
import io.smallrye.reactive.messaging.providers.extension.HealthCenter;

@ApplicationScoped
@Readiness
public class SmallRyeReactiveMessagingReadinessCheck implements HealthCheck {

    @Inject
    HealthCenter health;

    @Override
    public HealthCheckResponse call() {
        if (!health.isInitialized()) {
            return HealthChecks.NOT_YET_INITIALIZED;
        }

        HealthReport report = health.getReadiness();
        return HealthChecks.getHealthCheck(report, "readiness check");
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy