Package io.quarkus.restclient.config
Class RestClientsConfig
- java.lang.Object
-
- io.quarkus.restclient.config.RestClientsConfig
-
@ConfigRoot(name="rest-client", phase=RUN_TIME) public class RestClientsConfig extends Object
-
-
Field Summary
Fields Modifier and Type Field Description (package private) Map<String,RestClientConfig>configKeyConfigurations of REST client instances.Optional<Integer>connectionPoolSizeThe size of the connection pool for this client.Optional<Integer>connectionTTLThe time in ms for which a connection remains unused in the connection pool before being evicted and closed.LongconnectTimeoutA timeout in milliseconds that REST clients should wait to connect to the remote endpoint.booleandisableContextualErrorMessagesIf true, the REST clients will not provide additional contextual information (like REST client class and method names) when exception occurs during a client invocation.Optional<Boolean>disableSmartProducesBy default, REST Client Reactive uses text/plain content type for String values and application/json for everything else.Optional<Boolean>followRedirectsA boolean value used to determine whether the client should follow HTTP redirect responses.Map<String,String>headersThe HTTP headers that should be applied to all requests of the rest client.Optional<String>hostnameVerifierThe class name of the host name verifier.Optional<String>keyStoreThe key store location.Optional<String>keyStorePasswordThe key store password.Optional<String>keyStoreTypeThe type of the key store.RestClientLoggingConfigloggingOptional<Integer>maxRedirectsThe maximum number of redirection a request can follow.Optional<String>multipartPostEncoderModeMode in which the form data are encoded.Optional<String>nonProxyHostsHosts to access without proxy, similar to the http.nonProxyHosts or https.nonProxyHosts JVM settings.Optional<String>providersMap where keys are fully-qualified provider classnames to include in the client, and values are their integer priorities.Optional<String>proxyAddressA string value in the form of `: ` that specifies the HTTP proxy server hostname (or IP address) and port for requests of clients to use. Optional<String>proxyPasswordProxy password, equivalent to the http.proxyPassword or https.proxyPassword JVM settings.Optional<String>proxyUserProxy username, equivalent to the http.proxy or https.proxy JVM settings.Optional<org.eclipse.microprofile.rest.client.ext.QueryParamStyle>queryParamStyleAn enumerated type string value with possible values of "MULTI_PAIRS" (default), "COMMA_SEPARATED", or "ARRAY_PAIRS" that specifies the format in which multiple values for the same query parameter is used.LongreadTimeoutA timeout in milliseconds that REST clients should wait for a response from the remote endpoint.Optional<String>scopeThe CDI scope to use for injections of REST client instances.Optional<String>trustStoreThe trust store location.Optional<String>trustStorePasswordThe trust store password.Optional<String>trustStoreTypeThe type of the trust store.Optional<String>userAgentDefault configuration for the HTTP user-agent header to use in all REST clients.Optional<Boolean>verifyHostSet whether hostname verification is enabled.
-
Constructor Summary
Constructors Constructor Description RestClientsConfig()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description RestClientConfiggetClientConfig(Class<?> clientInterface)RestClientConfiggetClientConfig(String configKey)static RestClientsConfiggetInstance()voidputClientConfig(Class<?> clientInterface, RestClientConfig clientConfig)voidputClientConfig(String configKey, RestClientConfig clientConfig)
-
-
-
Field Detail
-
configKey
@ConfigItem(name="<<parent>>") Map<String,RestClientConfig> configKey
Configurations of REST client instances. The key can be either the value of the configKey parameter of a `@RegisterRestClient` annotation, or the name of a class bearing that annotation, in which case it is possible to use the short name, as well as fully qualified name.
-
disableSmartProduces
@ConfigItem(defaultValue="false") public Optional<Boolean> disableSmartProduces
By default, REST Client Reactive uses text/plain content type for String values and application/json for everything else. MicroProfile Rest Client spec requires the implementations to always default to application/json. This build item disables the "smart" behavior of RESTEasy Reactive to comply to the spec. This property is applicable to reactive REST clients only.
-
multipartPostEncoderMode
@ConfigItem public Optional<String> multipartPostEncoderMode
Mode in which the form data are encoded. Possible values are `HTML5`, `RFC1738` and `RFC3986`. The modes are described in the Netty documentation By default, Rest Client Reactive uses RFC1738. This property is applicable to reactive REST clients only.
-
proxyAddress
@ConfigItem public Optional<String> proxyAddress
A string value in the form of `: ` that specifies the HTTP proxy server hostname (or IP address) and port for requests of clients to use. Can be overwritten by client-specific settings.
-
proxyUser
@ConfigItem public Optional<String> proxyUser
Proxy username, equivalent to the http.proxy or https.proxy JVM settings. Can be overwritten by client-specific settings. This property is applicable to reactive REST clients only.
-
proxyPassword
@ConfigItem public Optional<String> proxyPassword
Proxy password, equivalent to the http.proxyPassword or https.proxyPassword JVM settings. Can be overwritten by client-specific settings. This property is applicable to reactive REST clients only.
-
nonProxyHosts
@ConfigItem public Optional<String> nonProxyHosts
Hosts to access without proxy, similar to the http.nonProxyHosts or https.nonProxyHosts JVM settings. Please note that unlike the JVM settings, this property is empty by default. Can be overwritten by client-specific settings. This property is applicable to reactive REST clients only.
-
logging
public RestClientLoggingConfig logging
-
connectTimeout
@ConfigItem(defaultValue="15000", defaultValueDocumentation="15000 ms") public Long connectTimeout
A timeout in milliseconds that REST clients should wait to connect to the remote endpoint. Can be overwritten by client-specific settings.
-
readTimeout
@ConfigItem(defaultValue="30000", defaultValueDocumentation="30000 ms") public Long readTimeout
A timeout in milliseconds that REST clients should wait for a response from the remote endpoint. Can be overwritten by client-specific settings.
-
disableContextualErrorMessages
@ConfigItem(defaultValue="false") public boolean disableContextualErrorMessages
If true, the REST clients will not provide additional contextual information (like REST client class and method names) when exception occurs during a client invocation. This property is applicable to reactive REST clients only.
-
userAgent
@ConfigItem public Optional<String> userAgent
Default configuration for the HTTP user-agent header to use in all REST clients. Can be overwritten by client-specific settings. This property is applicable to reactive REST clients only.
-
headers
@ConfigItem public Map<String,String> headers
The HTTP headers that should be applied to all requests of the rest client.
-
hostnameVerifier
@ConfigItem public Optional<String> hostnameVerifier
The class name of the host name verifier. The class must have a public no-argument constructor. Can be overwritten by client-specific settings.
-
connectionTTL
@ConfigItem public Optional<Integer> connectionTTL
The time in ms for which a connection remains unused in the connection pool before being evicted and closed. A timeout of0means there is no timeout. Can be overwritten by client-specific settings.
-
connectionPoolSize
@ConfigItem public Optional<Integer> connectionPoolSize
The size of the connection pool for this client. Can be overwritten by client-specific settings.
-
maxRedirects
@ConfigItem public Optional<Integer> maxRedirects
The maximum number of redirection a request can follow. Can be overwritten by client-specific settings. This property is applicable to reactive REST clients only.
-
followRedirects
@ConfigItem public Optional<Boolean> followRedirects
A boolean value used to determine whether the client should follow HTTP redirect responses. Can be overwritten by client-specific settings.
-
providers
@ConfigItem public Optional<String> providers
Map where keys are fully-qualified provider classnames to include in the client, and values are their integer priorities. The equivalent of the `@RegisterProvider` annotation. Can be overwritten by client-specific settings.
-
scope
@ConfigItem public Optional<String> scope
The CDI scope to use for injections of REST client instances. Value can be either a fully qualified class name of a CDI scope annotation (such as "javax.enterprise.context.ApplicationScoped") or its simple name (such as"ApplicationScoped"). Default scope for the rest-client extension is "Dependent" (which is the spec-compliant behavior). Default scope for the rest-client-reactive extension is "ApplicationScoped". Can be overwritten by client-specific settings.
-
queryParamStyle
@ConfigItem public Optional<org.eclipse.microprofile.rest.client.ext.QueryParamStyle> queryParamStyle
An enumerated type string value with possible values of "MULTI_PAIRS" (default), "COMMA_SEPARATED", or "ARRAY_PAIRS" that specifies the format in which multiple values for the same query parameter is used. Can be overwritten by client-specific settings.
-
verifyHost
@ConfigItem public Optional<Boolean> verifyHost
Set whether hostname verification is enabled. Can be overwritten by client-specific settings.
-
trustStore
@ConfigItem public Optional<String> trustStore
The trust store location. Can point to either a classpath resource or a file. Can be overwritten by client-specific settings.
-
trustStorePassword
@ConfigItem public Optional<String> trustStorePassword
The trust store password. Can be overwritten by client-specific settings.
-
trustStoreType
@ConfigItem public Optional<String> trustStoreType
The type of the trust store. Defaults to "JKS". Can be overwritten by client-specific settings.
-
keyStore
@ConfigItem public Optional<String> keyStore
The key store location. Can point to either a classpath resource or a file. Can be overwritten by client-specific settings.
-
keyStorePassword
@ConfigItem public Optional<String> keyStorePassword
The key store password. Can be overwritten by client-specific settings.
-
keyStoreType
@ConfigItem public Optional<String> keyStoreType
The type of the key store. Defaults to "JKS". Can be overwritten by client-specific settings.
-
-
Method Detail
-
getClientConfig
public RestClientConfig getClientConfig(String configKey)
-
getClientConfig
public RestClientConfig getClientConfig(Class<?> clientInterface)
-
putClientConfig
public void putClientConfig(String configKey, RestClientConfig clientConfig)
-
putClientConfig
public void putClientConfig(Class<?> clientInterface, RestClientConfig clientConfig)
-
getInstance
public static RestClientsConfig getInstance()
-
-