Class ServiceHttpClientConfiguration

java.lang.Object
io.micronaut.http.client.HttpClientConfiguration
io.micronaut.http.client.ServiceHttpClientConfiguration
All Implemented Interfaces:
ClientContextPathProvider

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

    • PREFIX

      public static final String PREFIX
      Prefix for HTTP Client settings.
      See Also:
    • DEFAULT_HEALTHCHECKURI

      public static final String DEFAULT_HEALTHCHECKURI
      The default health check uri.
      See Also:
    • DEFAULT_HEALTHCHECK

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

      public static final long DEFAULT_HEALTHCHECKINTERVAL_SECONDS
      The default health check interval in seconds.
      See Also:
  • Constructor Details

  • Method Details

    • getServiceId

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

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

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

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

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

      public void setHealthCheckUri(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 Optional<String> getPath()
      The context path to use for requests.
      Returns:
      The context path
    • setPath

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

      public Optional<String> getContextPath()
      Specified by:
      getContextPath in interface ClientContextPathProvider
      Returns:
      An optional context path
    • getHealthCheckInterval

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

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

      public HttpClientConfiguration.ConnectionPoolConfiguration getConnectionPoolConfiguration()
      Description copied from class: HttpClientConfiguration
      Obtains the connection pool configuration.
      Specified by:
      getConnectionPoolConfiguration in class HttpClientConfiguration
      Returns:
      The connection pool configuration.