Uploaded image for project: 'Red Hat Fuse'
  1. Red Hat Fuse
  2. ENTESB-8871

fabric8-karaf-checks custom probe impl

    XMLWordPrintable

Details

    • % %

    Description

      Following the example from doc I'm not able to implement custom probe that would affect health-check of readiness-check output.

      Anything I've missed, service registration etc.?

      package com.redhat.xpaas.qe.probes;
      
      import org.apache.felix.scr.annotations.Component;
      import org.apache.felix.scr.annotations.ConfigurationPolicy;
      import org.apache.felix.scr.annotations.Service;
      
      import org.slf4j.Logger;
      import org.slf4j.LoggerFactory;
      
      import java.util.Collections;
      import java.util.List;
      
      import io.fabric8.karaf.checks.Check;
      import io.fabric8.karaf.checks.HealthChecker;
      import io.fabric8.karaf.checks.ReadinessChecker;
      
      @Component(
      		name = "com.redhat.xpaas.qe.probes.RougeProbe",
      		immediate = true,
      		enabled = true,
      		policy = ConfigurationPolicy.IGNORE,
      		createPid = false
      )
      @Service({ReadinessChecker.class, HealthChecker.class})
      public class RougeProbe implements ReadinessChecker, HealthChecker {
      
      	private static final transient Logger LOG = LoggerFactory.getLogger(RougeProbe.class);
      
      	@Override
      	public List<Check> getFailingReadinessChecks() {
      		LOG.info("Calling readiness check");
      		return Collections.singletonList(new Check("rogue-readiness-probe", "Kill me now!"));
      	}
      
      	@Override
      	public List<Check> getFailingHeathChecks() {
      		LOG.info("Calling health check");
      		return Collections.singletonList(new Check("rogue-liveness-probe", "Kill me now!"));
      	}
      }
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            dsimansk@redhat.com David Simansky
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: