public interface MWHttpClientConfig
MWHttpClient. It provides the following
configuration parameters:
| Field Name | Description | Default Value |
| DEFAULT_IS_COOKIE_ENABLED | Determines if the client sets the HTTP cookie. | true |
| DEFAULT_IS_INTERRUPTABLE | Determines if the client can interrupt MATLABĀ® function execution. | false |
| DEFAULT_RESPONSE_SIZE_LIMIT | Maximum size, in bytes, of the response that a client accepts. | 64*1024*1024 (64 MB) |
| DEFAULT_NUM_CONNECTIONS_PER_ADDRESS | Maximum number of connections that the client opens to fulfill multiple requests. | -1, specifies that the client can uses as many connections as the system allows. |
| DEFAULT_TIMEOUT_MS | Amount of time, in milliseconds, that the client waits for a server response before timing out. | 120000 |
| DEFAULT_MAX_RETRIES | Maximum number of retry attempts for failed requests due to transient errors. | 3 |
| DEFAULT_RETRY_DELAY_MS | Initial delay, in milliseconds, before the first retry attempt. Subsequent retries use exponential backoff. | 500 |
| DEFAULT_MAX_RETRY_DELAY_MS | Upper bound, in milliseconds, on the exponential backoff delay between retries. | 30000 |
Users should extend MWHttpClientDefaultConfig to customize the configuration of
the client-server connection.
| Modifier and Type | Field and Description |
|---|---|
static boolean |
DEFAULT_IS_COOKIE_ENABLED |
static boolean |
DEFAULT_IS_INTERRUPTABLE |
static int |
DEFAULT_MAX_RETRIES |
static long |
DEFAULT_MAX_RETRY_DELAY_MS |
static int |
DEFAULT_NUM_CONNECTIONS_PER_ADDRESS |
static boolean |
DEFAULT_POLL_ON_UPDATE_ERROR_ASYNC |
static int |
DEFAULT_RESPONSE_SIZE_LIMIT |
static long |
DEFAULT_RETRY_DELAY_MS |
static long |
DEFAULT_TIMEOUT_MS |
| Modifier and Type | Method and Description |
|---|---|
int |
getMaxConnectionsPerAddress()
Get maximum number of connections per address used by
MWHttpClient to fulfill multiple
simultaneous requests created by client. |
int |
getMaxRetries()
Get the maximum number of retry attempts for failed requests due to transient errors.
|
long |
getMaxRetryDelayMs()
Get the upper bound, in milliseconds, on the exponential backoff delay between retries.
|
int |
getResponseSizeLimit()
Get the maximum response size the client can accept.
|
long |
getRetryDelayMs()
Get the initial delay, in milliseconds, before the first retry attempt.
|
long |
getTimeOutMs()
Get the time out in milliseconds for a client to receive response from the server.
|
boolean |
isCookieEnabled()
Use this API to enable handling of cookies in the client application.
|
boolean |
isInterruptible()
Tells whether this instance of
MWHttpClientConfig can be used for an interruptible
MWHttpClient |
boolean |
pollOnUpdateErrorAsync()
The return value of this method decides the behavior of the client when there is a loss of network connectivity
between the server and the client.
|
static final int DEFAULT_NUM_CONNECTIONS_PER_ADDRESS
static final long DEFAULT_TIMEOUT_MS
static final boolean DEFAULT_IS_INTERRUPTABLE
static final int DEFAULT_RESPONSE_SIZE_LIMIT
static final boolean DEFAULT_IS_COOKIE_ENABLED
static final boolean DEFAULT_POLL_ON_UPDATE_ERROR_ASYNC
static final int DEFAULT_MAX_RETRIES
static final long DEFAULT_RETRY_DELAY_MS
static final long DEFAULT_MAX_RETRY_DELAY_MS
int getMaxConnectionsPerAddress()
MWHttpClient to fulfill multiple
simultaneous requests created by client. If this configuration is meant for non-interruptible instance
of MWHttpClient, user defined implementations of this method must return -1.long getTimeOutMs()
boolean isInterruptible()
MWHttpClientConfig can be used for an interruptible
MWHttpClientMWHttpClientConfig can be used for an interruptible
MWHttpClient else returns falseint getResponseSizeLimit()
boolean isCookieEnabled()
boolean pollOnUpdateErrorAsync()
int getMaxRetries()
ConnectException, SocketTimeoutException, and NoHttpResponseException.
Non-transient errors such as SSL errors are never retried regardless of this setting.
Set to 0 to disable retries.long getRetryDelayMs()
getMaxRetryDelayMs().long getMaxRetryDelayMs()
min(getRetryDelayMs() * 2^n, getMaxRetryDelayMs()).Copyright 2010-2022 The MathWorks, Inc.