@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 java.lang.String |
DEFAULT_HEALTHCHECKURI
The default health check uri.
|
static java.lang.String |
PREFIX
Prefix for HTTP Client settings.
|
DEFAULT_EXCEPTION_ON_ERROR_STATUS, DEFAULT_FOLLOW_REDIRECTS, DEFAULT_MAX_CONTENT_LENGTH, DEFAULT_READ_IDLE_TIMEOUT_MINUTES, DEFAULT_READ_TIMEOUT_SECONDS, DEFAULT_SHUTDOWN_TIMEOUT_MILLISECONDS
Constructor and Description |
---|
ServiceHttpClientConfiguration(java.lang.String serviceId,
ServiceHttpClientConfiguration.ServiceConnectionPoolConfiguration connectionPoolConfiguration,
ServiceHttpClientConfiguration.ServiceSslClientConfiguration sslConfiguration,
ApplicationConfiguration applicationConfiguration)
Creates a new client configuration for the given service ID.
|
ServiceHttpClientConfiguration(java.lang.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.
|
java.util.Optional<java.lang.String> |
getContextPath() |
java.time.Duration |
getHealthCheckInterval()
The default duration to check health status.
|
java.lang.String |
getHealthCheckUri()
The URI to check the service for health status.
|
java.util.Optional<java.lang.String> |
getPath()
The context path to use for requests.
|
java.lang.String |
getServiceId()
The service id.
|
java.util.List<java.net.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(java.time.Duration healthCheckInterval)
Sets the default duration to check health status.
|
void |
setHealthCheckUri(java.lang.String healthCheckUri)
Sets the health check URI.
|
void |
setPath(java.lang.String path)
Sets the context path to use for requests.
|
void |
setUrl(java.net.URI url)
Sets the URL of the service.
|
void |
setUrls(java.util.List<java.net.URI> urls)
Sets the URIs of the service.
|
getChannelOptions, getConnectTimeout, getConnectTtl, getDefaultCharset, getEventLoopGroup, getHttpVersion, getLoggerName, getLogLevel, getMaxContentLength, getNumOfThreads, getProxyAddress, getProxyPassword, getProxySelector, getProxyType, getProxyUsername, getReadIdleTimeout, getReadTimeout, getShutdownTimeout, getSslConfiguration, getThreadFactory, isExceptionOnErrorStatus, isFollowRedirects, resolveProxy, setChannelOptions, setConnectTimeout, setConnectTtl, setDefaultCharset, setEventLoopGroup, setExceptionOnErrorStatus, setFollowRedirects, setHttpVersion, setLoggerName, setLogLevel, setMaxContentLength, setNumOfThreads, setProxyAddress, setProxyPassword, setProxySelector, setProxyType, setProxyUsername, setReadIdleTimeout, setReadTimeout, setShutdownTimeout, setSslConfiguration, setThreadFactory
public static final java.lang.String PREFIX
public static final java.lang.String DEFAULT_HEALTHCHECKURI
public static final boolean DEFAULT_HEALTHCHECK
public static final long DEFAULT_HEALTHCHECKINTERVAL_SECONDS
public ServiceHttpClientConfiguration(@Parameter java.lang.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 java.lang.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 java.lang.String getServiceId()
public java.util.List<java.net.URI> getUrls()
public void setUrls(java.util.List<java.net.URI> urls)
urls
- The URIspublic void setUrl(java.net.URI url)
url
- The URIpublic java.lang.String getHealthCheckUri()
public void setHealthCheckUri(java.lang.String healthCheckUri)
healthCheckUri
- The health check URIpublic boolean isHealthCheck()
public void setHealthCheck(boolean healthCheck)
healthCheck
- True if the health should be checkedpublic java.util.Optional<java.lang.String> getPath()
public void setPath(java.lang.String path)
path
- The context pathpublic java.util.Optional<java.lang.String> getContextPath()
getContextPath
in interface ClientContextPathProvider
public java.time.Duration getHealthCheckInterval()
public void setHealthCheckInterval(java.time.Duration healthCheckInterval)
healthCheckInterval
- The durationpublic HttpClientConfiguration.ConnectionPoolConfiguration getConnectionPoolConfiguration()
HttpClientConfiguration
getConnectionPoolConfiguration
in class HttpClientConfiguration