Class KafkaHealthIndicator

java.lang.Object
io.micronaut.configuration.kafka.health.KafkaHealthIndicator
All Implemented Interfaces:
io.micronaut.core.order.Ordered, io.micronaut.management.health.indicator.HealthIndicator, ClusterResourceListener

@Singleton @Requires(bean=KafkaDefaultConfiguration.class) @Requires(property="kafka.health.enabled",value="true",defaultValue="true") public class KafkaHealthIndicator extends Object implements io.micronaut.management.health.indicator.HealthIndicator, ClusterResourceListener
A HealthIndicator for Kafka.
Since:
1.0
Author:
Graeme Rocher
  • Constructor Details

  • Method Details

    • onUpdate

      public void onUpdate(ClusterResource clusterResource)
      Specified by:
      onUpdate in interface ClusterResourceListener
    • getClusterReplicationFactor

      public static int getClusterReplicationFactor(Config config)
      Retrieve the cluster "offsets.topic.replication.factor" for the given Config, falling back to "default.replication.factor" if required, in order to support Confluent Cloud hosted Kafka.
      Parameters:
      config - the cluster Config
      Returns:
      the cluster replication factor, or Integer.MAX_VALUE if none found
    • getMinNodeCount

      public static int getMinNodeCount(Config config)
      Retrieve the cluster "min.insync.replicas" for the given Config, falling back to "offsets.topic.replication.factor" or "default.replication.factor" if required, in order to support Confluent Cloud hosted Kafka.
      Parameters:
      config - the cluster Config
      Returns:
      the optional cluster minimum number of replicas that must acknowledge a write
    • getResult

      public reactor.core.publisher.Flux<io.micronaut.management.health.indicator.HealthResult> getResult()
      Specified by:
      getResult in interface io.micronaut.management.health.indicator.HealthIndicator