Search in sources :

Example 1 with InfinispanClusterManager

use of io.vertx.ext.cluster.infinispan.InfinispanClusterManager in project vertx-openshift-it by cescoffier.

the class EventBusSenderVerticle method createHealthChecks.

private HealthChecks createHealthChecks() {
    return HealthChecks.create(vertx).register("ispn-cluster-status", future -> {
        VertxInternal vertxInternal = (VertxInternal) vertx;
        InfinispanClusterManager clusterManager = (InfinispanClusterManager) vertxInternal.getClusterManager();
        EmbeddedCacheManager cacheManager = (EmbeddedCacheManager) clusterManager.getCacheContainer();
        Health health = cacheManager.getHealth();
        HealthStatus healthStatus = health.getClusterHealth().getHealthStatus();
        Status status = new Status().setOk(healthStatus == HealthStatus.HEALTHY).setData(JsonObject.mapFrom(health));
        future.complete(status);
    });
}
Also used : Status(io.vertx.ext.healthchecks.Status) HealthStatus(org.infinispan.health.HealthStatus) VertxInternal(io.vertx.core.impl.VertxInternal) Health(org.infinispan.health.Health) InfinispanClusterManager(io.vertx.ext.cluster.infinispan.InfinispanClusterManager) HealthStatus(org.infinispan.health.HealthStatus) EmbeddedCacheManager(org.infinispan.manager.EmbeddedCacheManager)

Example 2 with InfinispanClusterManager

use of io.vertx.ext.cluster.infinispan.InfinispanClusterManager in project vertx-openshift-it by cescoffier.

the class AsyncMapVerticle method createHealthChecks.

private HealthChecks createHealthChecks() {
    return HealthChecks.create(vertx).register("ispn-cluster-status", future -> {
        VertxInternal vertxInternal = (VertxInternal) vertx;
        InfinispanClusterManager clusterManager = (InfinispanClusterManager) vertxInternal.getClusterManager();
        EmbeddedCacheManager cacheManager = (EmbeddedCacheManager) clusterManager.getCacheContainer();
        Health health = cacheManager.getHealth();
        HealthStatus healthStatus = health.getClusterHealth().getHealthStatus();
        Status status = new Status().setOk(healthStatus == HealthStatus.HEALTHY).setData(JsonObject.mapFrom(health));
        future.complete(status);
    });
}
Also used : Status(io.vertx.ext.healthchecks.Status) HealthStatus(org.infinispan.health.HealthStatus) VertxInternal(io.vertx.core.impl.VertxInternal) Health(org.infinispan.health.Health) InfinispanClusterManager(io.vertx.ext.cluster.infinispan.InfinispanClusterManager) HealthStatus(org.infinispan.health.HealthStatus) EmbeddedCacheManager(org.infinispan.manager.EmbeddedCacheManager)

Example 3 with InfinispanClusterManager

use of io.vertx.ext.cluster.infinispan.InfinispanClusterManager in project vertx-openshift-it by cescoffier.

the class EventBusReceiverVerticle method createHealthChecks.

private HealthChecks createHealthChecks() {
    return HealthChecks.create(vertx).register("ispn-cluster-status", future -> {
        VertxInternal vertxInternal = (VertxInternal) vertx;
        InfinispanClusterManager clusterManager = (InfinispanClusterManager) vertxInternal.getClusterManager();
        EmbeddedCacheManager cacheManager = (EmbeddedCacheManager) clusterManager.getCacheContainer();
        Health health = cacheManager.getHealth();
        HealthStatus healthStatus = health.getClusterHealth().getHealthStatus();
        Status status = new Status().setOk(healthStatus == HealthStatus.HEALTHY).setData(JsonObject.mapFrom(health));
        future.complete(status);
    });
}
Also used : Status(io.vertx.ext.healthchecks.Status) HealthStatus(org.infinispan.health.HealthStatus) VertxInternal(io.vertx.core.impl.VertxInternal) Health(org.infinispan.health.Health) InfinispanClusterManager(io.vertx.ext.cluster.infinispan.InfinispanClusterManager) HealthStatus(org.infinispan.health.HealthStatus) EmbeddedCacheManager(org.infinispan.manager.EmbeddedCacheManager)

Aggregations

VertxInternal (io.vertx.core.impl.VertxInternal)3 InfinispanClusterManager (io.vertx.ext.cluster.infinispan.InfinispanClusterManager)3 Status (io.vertx.ext.healthchecks.Status)3 Health (org.infinispan.health.Health)3 HealthStatus (org.infinispan.health.HealthStatus)3 EmbeddedCacheManager (org.infinispan.manager.EmbeddedCacheManager)3