Class ServiceHttpClientConfiguration

  • All Implemented Interfaces:
    io.micronaut.http.context.ClientContextPathProvider

    @EachProperty("micronaut.http.services")
    public class ServiceHttpClientConfiguration
    extends HttpClientConfiguration
    implements io.micronaut.http.context.ClientContextPathProvider
    Allows defining HTTP client configurations via the micronaut.http.services setting.
    Since:
    1.0
    • Field Detail

      • PREFIX

        public static final java.lang.String PREFIX
        Prefix for HTTP Client settings.
        See Also:
        Constant Field Values
      • DEFAULT_HEALTHCHECKURI

        public static final java.lang.String DEFAULT_HEALTHCHECKURI
        The default health check uri.
        See Also:
        Constant Field Values
      • DEFAULT_HEALTHCHECK

        public static final boolean DEFAULT_HEALTHCHECK
        The default health check value.
        See Also:
        Constant Field Values
      • DEFAULT_HEALTHCHECKINTERVAL_SECONDS

        public static final long DEFAULT_HEALTHCHECKINTERVAL_SECONDS
        The default health check interval in seconds.
        See Also:
        Constant Field Values
    • Method Detail

      • getServiceId

        public java.lang.String getServiceId()
        The service id.
        Returns:
        The ID of the service
      • getUrls

        public java.util.List<java.net.URI> getUrls()
        The URLs.
        Returns:
        The URLs of the service
      • setUrls

        public void setUrls​(java.util.List<java.net.URI> urls)
        Sets the URIs of the service.
        Parameters:
        urls - The URIs
      • setUrl

        public void setUrl​(java.net.URI url)
        Sets the URL of the service.
        Parameters:
        url - The URI
      • getHealthCheckUri

        public java.lang.String getHealthCheckUri()
        The URI to check the service for health status.
        Returns:
        The health status uri
      • setHealthCheckUri

        public void setHealthCheckUri​(java.lang.String healthCheckUri)
        Sets the health check URI. Default value ("/health").
        Parameters:
        healthCheckUri - The health check URI
      • isHealthCheck

        public boolean isHealthCheck()
        Whether the service health should be checked.
        Returns:
        True if the health should be checked
      • setHealthCheck

        public void setHealthCheck​(boolean healthCheck)
        Sets whether the service health should be checked. Default value (false).
        Parameters:
        healthCheck - True if the health should be checked
      • getPath

        public java.util.Optional<java.lang.String> getPath()
        The context path to use for requests.
        Returns:
        The context path
      • setPath

        public void setPath​(java.lang.String path)
        Sets the context path to use for requests.
        Parameters:
        path - The context path
      • getContextPath

        public java.util.Optional<java.lang.String> getContextPath()
        Specified by:
        getContextPath in interface io.micronaut.http.context.ClientContextPathProvider
      • getHealthCheckInterval

        public java.time.Duration getHealthCheckInterval()
        The default duration to check health status.
        Returns:
        The duration
      • setHealthCheckInterval

        public void setHealthCheckInterval​(java.time.Duration healthCheckInterval)
        Sets the default duration to check health status. Default value (30L seconds).
        Parameters:
        healthCheckInterval - The duration