Class HealthResultFilter

  • All Implemented Interfaces:
    io.micronaut.core.order.Ordered, io.micronaut.http.filter.HttpFilter, io.micronaut.http.filter.HttpServerFilter

    @Filter({"${endpoints.all.path:/}${endpoints.health.id:health}","${endpoints.all.path:/}${endpoints.health.id:health}/liveness","${endpoints.all.path:/}${endpoints.health.id:health}/readiness"})
    @Requires(beans=HealthEndpoint.class)
    public class HealthResultFilter
    extends io.micronaut.http.filter.OncePerRequestHttpServerFilter
    A filter that matches the HealthEndpoint and returns an appropriate HTTP status code.
    Since:
    1.0
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String DEFAULT_MAPPING
      Configurable default mapping for filter.
      static java.lang.String LIVENESS_PROBE_MAPPING  
      static java.lang.String READINESS_PROBE_MAPPING  
      • Fields inherited from interface io.micronaut.core.order.Ordered

        HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected org.reactivestreams.Publisher<io.micronaut.http.MutableHttpResponse<?>> doFilterOnce​(io.micronaut.http.HttpRequest<?> request, io.micronaut.http.filter.ServerFilterChain chain)  
      • Methods inherited from class io.micronaut.http.filter.OncePerRequestHttpServerFilter

        doFilter, getKey
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface io.micronaut.http.filter.HttpServerFilter

        doFilter
      • Methods inherited from interface io.micronaut.core.order.Ordered

        getOrder
    • Field Detail

      • DEFAULT_MAPPING

        public static final java.lang.String DEFAULT_MAPPING
        Configurable default mapping for filter.
        See Also:
        Constant Field Values
      • LIVENESS_PROBE_MAPPING

        public static final java.lang.String LIVENESS_PROBE_MAPPING
        See Also:
        Constant Field Values
      • READINESS_PROBE_MAPPING

        public static final java.lang.String READINESS_PROBE_MAPPING
        See Also:
        Constant Field Values
    • Constructor Detail

      • HealthResultFilter

        protected HealthResultFilter​(HealthEndpoint healthEndpoint)
        Default constructor.
        Parameters:
        healthEndpoint - The health endpoint
    • Method Detail

      • doFilterOnce

        protected org.reactivestreams.Publisher<io.micronaut.http.MutableHttpResponse<?>> doFilterOnce​(io.micronaut.http.HttpRequest<?> request,
                                                                                                       io.micronaut.http.filter.ServerFilterChain chain)
        Specified by:
        doFilterOnce in class io.micronaut.http.filter.OncePerRequestHttpServerFilter