yurake/k8s-3tier-webapp

View on GitHub
application/consumer-hazelcast-quarkus/src/main/java/webapp/tier/healthcheck/ReadinessHealthCheckHazelcastSubscriber.java

Summary

Maintainability
A
0 mins
Test Coverage
package webapp.tier.healthcheck;

import javax.enterprise.context.ApplicationScoped;

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

import webapp.tier.service.HazelcastSubscribeService;

@Readiness
@ApplicationScoped
public class ReadinessHealthCheckHazelcastSubscriber implements HealthCheck {

    @Override
    public HealthCheckResponse call() {
        String msg = "Hazelcast Server connection health check";
        return HealthCheckUtils.respHealthCheckStatus(
                HazelcastSubscribeService.getInstance().isActive(), msg);
    }
}