@EachProperty(value="micronaut.http.services") public class ServiceHttpClientConfiguration extends HttpClientConfiguration implements ClientContextPathProvider
micronaut.http.services
setting.Modifier and Type | Class and Description |
---|---|
static class |
ServiceHttpClientConfiguration.ServiceConnectionPoolConfiguration
The default connection pool configuration.
|
static class |
ServiceHttpClientConfiguration.ServiceSslClientConfiguration
The default connection pool configuration.
|
HttpClientConfiguration.ConnectionPoolConfiguration
Modifier and Type | Field and Description |
---|---|
static boolean |
DEFAULT_HEALTHCHECK
The default health check value.
|
static long |
DEFAULT_HEALTHCHECKINTERVAL_SECONDS
The default health check interval in seconds.
|
static String |
DEFAULT_HEALTHCHECKURI
The default health check uri.
|
static String |
PREFIX
Prefix for HTTP Client settings.
|
DEFAULT_CONNECTION_POOL_IDLE_TIMEOUT_SECONDS, 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 and Description |
---|
ServiceHttpClientConfiguration(String serviceId,
ServiceHttpClientConfiguration.ServiceConnectionPoolConfiguration connectionPoolConfiguration,
ServiceHttpClientConfiguration.ServiceSslClientConfiguration sslConfiguration,
ApplicationConfiguration applicationConfiguration)
Creates a new client configuration for the given service ID.
|
ServiceHttpClientConfiguration(String serviceId,
ServiceHttpClientConfiguration.ServiceConnectionPoolConfiguration connectionPoolConfiguration,
ServiceHttpClientConfiguration.ServiceSslClientConfiguration sslConfiguration,
HttpClientConfiguration defaultHttpClientConfiguration)
Creates a new client configuration for the given service ID.
|
Modifier and Type | Method and Description |
---|---|
HttpClientConfiguration.ConnectionPoolConfiguration |
getConnectionPoolConfiguration()
Obtains the connection pool configuration.
|
Optional<String> |
getContextPath() |
Duration |
getHealthCheckInterval()
The default duration to check health status.
|
String |
getHealthCheckUri()
The URI to check the service for health status.
|
Optional<String> |
getPath()
The context path to use for requests.
|
String |
getServiceId()
The service id.
|
List<URI> |
getUrls()
The URLs.
|
boolean |
isHealthCheck()
Whether the service health should be checked.
|
void |
setHealthCheck(boolean healthCheck)
Sets whether the service health should be checked.
|
void |
setHealthCheckInterval(Duration healthCheckInterval)
Sets the default duration to check health status.
|
void |
setHealthCheckUri(String healthCheckUri)
Sets the health check URI.
|
void |
setPath(String path)
Sets the context path to use for requests.
|
void |
setUrl(URI url)
Sets the URL of the service.
|
void |
setUrls(List<URI> urls)
Sets the URIs of the service.
|
getChannelOptions, getConnectionPoolIdleTimeout, getConnectTimeout, getConnectTtl, getDefaultCharset, getEventLoopGroup, getHttpVersion, getLoggerName, getLogLevel, getMaxContentLength, getNumOfThreads, getProxyAddress, getProxyPassword, getProxySelector, getProxyType, getProxyUsername, getReadIdleTimeout, getReadTimeout, getShutdownQuietPeriod, getShutdownTimeout, getSslConfiguration, getThreadFactory, isExceptionOnErrorStatus, isFollowRedirects, resolveProxy, setChannelOptions, setConnectionPoolIdleTimeout, setConnectTimeout, setConnectTtl, setDefaultCharset, setEventLoopGroup, setExceptionOnErrorStatus, setFollowRedirects, setHttpVersion, setLoggerName, setLogLevel, setMaxContentLength, setNumOfThreads, setProxyAddress, setProxyPassword, setProxySelector, setProxyType, setProxyUsername, setReadIdleTimeout, setReadTimeout, setShutdownQuietPeriod, setShutdownTimeout, setSslConfiguration, setThreadFactory
public static final String PREFIX
public static final String DEFAULT_HEALTHCHECKURI
public static final boolean DEFAULT_HEALTHCHECK
public static final long DEFAULT_HEALTHCHECKINTERVAL_SECONDS
public ServiceHttpClientConfiguration(@Parameter String serviceId, @Nullable ServiceHttpClientConfiguration.ServiceConnectionPoolConfiguration connectionPoolConfiguration, @Nullable ServiceHttpClientConfiguration.ServiceSslClientConfiguration sslConfiguration, ApplicationConfiguration applicationConfiguration)
serviceId
- The service idconnectionPoolConfiguration
- The connection pool configurationsslConfiguration
- The SSL configurationapplicationConfiguration
- The application configuration@Inject public ServiceHttpClientConfiguration(@Parameter String serviceId, @Nullable ServiceHttpClientConfiguration.ServiceConnectionPoolConfiguration connectionPoolConfiguration, @Nullable ServiceHttpClientConfiguration.ServiceSslClientConfiguration sslConfiguration, HttpClientConfiguration defaultHttpClientConfiguration)
serviceId
- The service idconnectionPoolConfiguration
- The connection pool configurationsslConfiguration
- The SSL configurationdefaultHttpClientConfiguration
- The default HTTP client configurationpublic String getServiceId()
public void setUrls(List<URI> urls)
urls
- The URIspublic void setUrl(URI url)
url
- The URIpublic String getHealthCheckUri()
public void setHealthCheckUri(String healthCheckUri)
healthCheckUri
- The health check URIpublic boolean isHealthCheck()
public void setHealthCheck(boolean healthCheck)
healthCheck
- True if the health should be checkedpublic Optional<String> getPath()
public void setPath(String path)
path
- The context pathpublic Optional<String> getContextPath()
getContextPath
in interface ClientContextPathProvider
public Duration getHealthCheckInterval()
public void setHealthCheckInterval(Duration healthCheckInterval)
healthCheckInterval
- The durationpublic HttpClientConfiguration.ConnectionPoolConfiguration getConnectionPoolConfiguration()
HttpClientConfiguration
getConnectionPoolConfiguration
in class HttpClientConfiguration