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
Modifier and TypeClassDescriptionstatic 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 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
ConstructorDescriptionDefault constructor.SpringCloudClientConfiguration
(SpringCloudClientConfiguration.SpringCloudConnectionPoolConfiguration springCloudConnectionPoolConfiguration, io.micronaut.runtime.ApplicationConfiguration applicationConfiguration) -
Method Summary
Modifier and TypeMethodDescription@NonNull io.micronaut.http.client.HttpClientConfiguration.ConnectionPoolConfiguration
getLabel()
getName()
getUri()
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
-
Field Details
-
PREFIX
- See Also:
-
SPRING_CLOUD_CONFIG_ENDPOINT
- See Also:
-
-
Constructor Details
-
SpringCloudClientConfiguration
public SpringCloudClientConfiguration()Default constructor. -
SpringCloudClientConfiguration
@Inject public SpringCloudClientConfiguration(SpringCloudClientConfiguration.SpringCloudConnectionPoolConfiguration springCloudConnectionPoolConfiguration, io.micronaut.runtime.ApplicationConfiguration applicationConfiguration) - Parameters:
springCloudConnectionPoolConfiguration
- The connection pool configurationapplicationConfiguration
- The application configuration
-
-
Method Details
-
getConnectionPoolConfiguration
@NonNull public @NonNull io.micronaut.http.client.HttpClientConfiguration.ConnectionPoolConfiguration getConnectionPoolConfiguration()- Specified by:
getConnectionPoolConfiguration
in classio.micronaut.http.client.HttpClientConfiguration
-
getConfiguration
@NonNull public @NonNull SpringCloudClientConfiguration.SpringConfigDiscoveryConfiguration getConfiguration()- Returns:
- The configuration discovery configuration
-
getUri
- Returns:
- The spring cloud config server uri
-
setUri
Set the Spring Cloud config server uri. Default value ("http://localhost:8888").- Parameters:
uri
- Spring Cloud config server uri
-
getLabel
- Returns:
- The spring cloud config server label
-
getName
- Returns:
- The spring cloud config server name. Default value is read from micronaut.application.name
-
getUsername
- Returns:
- The spring cloud config username.
-
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
Set the Spring Cloud config server label.- Parameters:
label
- Spring Cloud config server label
-
setName
Set the Spring Cloud config server name.- Parameters:
name
- Spring Cloud config server name
-
setUsername
Set the Spring cloud config username.- Parameters:
username
- Spring Cloud config username
-
setPassword
Set the Spring cloud config password.- Parameters:
password
- Spring Cloud config password
-