Class SpringCloudClientConfiguration

java.lang.Object
io.micronaut.http.client.HttpClientConfiguration
io.micronaut.discovery.spring.config.SpringCloudClientConfiguration

@ConfigurationProperties("spring.cloud.config") @Requires(property="spring.cloud.config.enabled", value="true", defaultValue="false") public class SpringCloudClientConfiguration extends io.micronaut.http.client.HttpClientConfiguration
A HttpClientConfiguration for Spring Cloud Config.
Since:
1.0
Author:
Thiago Locatelli, graemerocher
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
    The default connection pool configuration.
    static class 
    Configuration class for Consul client config.

    Nested classes/interfaces inherited from class io.micronaut.http.client.HttpClientConfiguration

    io.micronaut.http.client.HttpClientConfiguration.ConnectionPoolConfiguration, io.micronaut.http.client.HttpClientConfiguration.DnsResolutionMode, io.micronaut.http.client.HttpClientConfiguration.Http2ClientConfiguration, io.micronaut.http.client.HttpClientConfiguration.WebSocketCompressionConfiguration
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
     
    static final String
     

    Fields inherited from class io.micronaut.http.client.HttpClientConfiguration

    DEFAULT_ALLOW_BLOCK_EVENT_LOOP, DEFAULT_CONNECTION_POOL_IDLE_TIMEOUT_SECONDS, DEFAULT_DNS_RESOLUTION_MODE, DEFAULT_EXCEPTION_ON_ERROR_STATUS, DEFAULT_FOLLOW_REDIRECTS, DEFAULT_MAX_CONTENT_LENGTH, DEFAULT_READ_IDLE_TIMEOUT_MINUTES, DEFAULT_READ_TIMEOUT_SECONDS, DEFAULT_SHUTDOWN_QUIET_PERIOD_MILLISECONDS, DEFAULT_SHUTDOWN_TIMEOUT_MILLISECONDS
  • Constructor Summary

    Constructors
    Constructor
    Description
    Default constructor.
    SpringCloudClientConfiguration(SpringCloudClientConfiguration.SpringCloudConnectionPoolConfiguration springCloudConnectionPoolConfiguration, io.micronaut.runtime.ApplicationConfiguration applicationConfiguration)
     
  • Method Summary

    Modifier and Type
    Method
    Description
     
    @NonNull io.micronaut.http.client.HttpClientConfiguration.ConnectionPoolConfiguration
     
     
     
     
    @NonNull Optional<String>
     
     
    boolean
     
    void
    setFailFast(boolean failFast)
    If set to true an exception will be thrown if configuration is not found.
    void
    Set the Spring Cloud config server label.
    void
    Set the Spring Cloud config server name.
    void
    setPassword(@Nullable String password)
    Set the Spring cloud config password.
    void
    Set the Spring Cloud config server uri.
    void
    setUsername(@Nullable String username)
    Set the Spring cloud config username.

    Methods inherited from class io.micronaut.http.client.HttpClientConfiguration

    getAddressResolverGroupName, getAlpnModes, getChannelOptions, getConnectionPoolIdleTimeout, getConnectTimeout, getConnectTtl, getDefaultCharset, getDnsResolutionMode, getEventLoopGroup, getHttp2Configuration, getHttpVersion, getLoggerName, getLogLevel, getMaxContentLength, getNumOfThreads, getPlaintextMode, getProxyAddress, getProxyPassword, getProxySelector, getProxyType, getProxyUsername, getReadIdleTimeout, getReadTimeout, getRequestTimeout, getShutdownQuietPeriod, getShutdownTimeout, getSslConfiguration, getThreadFactory, getWebSocketCompressionConfiguration, isAllowBlockEventLoop, isExceptionOnErrorStatus, isFollowRedirects, resolveProxy, setAddressResolverGroupName, setAllowBlockEventLoop, setAlpnModes, setChannelOptions, setConnectionPoolIdleTimeout, setConnectTimeout, setConnectTtl, setDefaultCharset, setDnsResolutionMode, setEventLoopGroup, setExceptionOnErrorStatus, setFollowRedirects, setHttpVersion, setLoggerName, setLogLevel, setMaxContentLength, setNumOfThreads, setPlaintextMode, setProxyAddress, setProxyPassword, setProxySelector, setProxyType, setProxyUsername, setReadIdleTimeout, setReadTimeout, setRequestTimeout, setShutdownQuietPeriod, setShutdownTimeout, setSslConfiguration, setThreadFactory

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • SpringCloudClientConfiguration

      public SpringCloudClientConfiguration()
      Default constructor.
    • SpringCloudClientConfiguration

      @Inject public SpringCloudClientConfiguration(SpringCloudClientConfiguration.SpringCloudConnectionPoolConfiguration springCloudConnectionPoolConfiguration, io.micronaut.runtime.ApplicationConfiguration applicationConfiguration)
      Parameters:
      springCloudConnectionPoolConfiguration - The connection pool configuration
      applicationConfiguration - The application configuration
  • Method Details

    • getConnectionPoolConfiguration

      @NonNull public @NonNull io.micronaut.http.client.HttpClientConfiguration.ConnectionPoolConfiguration getConnectionPoolConfiguration()
      Specified by:
      getConnectionPoolConfiguration in class io.micronaut.http.client.HttpClientConfiguration
    • getConfiguration

      @NonNull public @NonNull SpringCloudClientConfiguration.SpringConfigDiscoveryConfiguration getConfiguration()
      Returns:
      The configuration discovery configuration
    • getUri

      @NonNull public @NonNull Optional<String> getUri()
      Returns:
      The spring cloud config server uri
    • setUri

      public void setUri(String uri)
      Set the Spring Cloud config server uri. Default value ("http://localhost:8888").
      Parameters:
      uri - Spring Cloud config server uri
    • getLabel

      public String getLabel()
      Returns:
      The spring cloud config server label
    • getName

      public Optional<String> getName()
      Returns:
      The spring cloud config server name. Default value is read from micronaut.application.name
    • getUsername

      public Optional<String> getUsername()
      Returns:
      The spring cloud config username.
    • getPassword

      public Optional<String> getPassword()
      Returns:
      The spring cloud config password.
    • isFailFast

      public boolean isFailFast()
      Returns:
      Flag to indicate that failure to connect to Spring Cloud Config is fatal (default false).
    • setFailFast

      public void setFailFast(boolean failFast)
      If set to true an exception will be thrown if configuration is not found. Default value ().
      Parameters:
      failFast - flag to fail fast
    • setLabel

      public void setLabel(String label)
      Set the Spring Cloud config server label.
      Parameters:
      label - Spring Cloud config server label
    • setName

      public void setName(String name)
      Set the Spring Cloud config server name.
      Parameters:
      name - Spring Cloud config server name
    • setUsername

      public void setUsername(@Nullable @Nullable String username)
      Set the Spring cloud config username.
      Parameters:
      username - Spring Cloud config username
    • setPassword

      public void setPassword(@Nullable @Nullable String password)
      Set the Spring cloud config password.
      Parameters:
      password - Spring Cloud config password