public class ConnectionConfiguration extends Object
Constructor | Description |
---|---|
ConnectionConfiguration() |
Modifier and Type | Method | Description |
---|---|---|
ConnectionConfiguration |
connectionMaxIdleMillis(long connectionMaxIdleMillis) |
Sets the maximum amount of time that an idle connection may sit in the connection pool and
still be eligible for reuse.
|
ConnectionConfiguration |
connectionTtl(long connectionTtl) |
Sets the expiration time (in milliseconds) for a connection in the connection pool.
|
Optional<Long> |
getConnectionMaxIdleMillis() |
Returns an
Optional which contains the maximum amount of time that an idle connection may sit in the connection
pool and still be eligible for reuse. |
Optional<Long> |
getConnectionTtl() |
Returns an
Optional that contains the expiration time (in milliseconds) for a connection in the connection pool. |
Optional<Integer> |
getMaxConnections() |
Returns an
Optional that contains the maximum number of allowed open HTTP connections. |
Optional<Boolean> |
isUseReaper() |
Checks if the
IdleConnectionReaper is to be started. |
ConnectionConfiguration |
maxConnections(int maxConnections) |
Sets the maximum number of allowed open HTTP connections.
|
void |
setConnectionMaxIdleMillis(Long connectionMaxIdleMillis) |
Sets the maximum amount of time that an idle connection may sit in the connection pool and
still be eligible for reuse.
|
void |
setConnectionTtl(Long connectionTtl) |
Sets the expiration time (in milliseconds) for a connection in the connection pool.
|
void |
setMaxConnections(Integer maxConnections) |
Sets the maximum number of allowed open HTTP connections.
|
void |
setUseReaper(Boolean useReaper) |
Sets whether the
IdleConnectionReaper is to be started as a daemon thread. |
ConnectionConfiguration |
useReaper(boolean useReaper) |
Sets whether the
IdleConnectionReaper is to be started as a daemon thread. |
public Optional<Integer> getMaxConnections()
Optional
that contains the maximum number of allowed open HTTP connections.
Default value is .
public void setMaxConnections(Integer maxConnections)
Default value is .
maxConnections
- The maximum number of allowed open HTTP connections.public ConnectionConfiguration maxConnections(int maxConnections)
Default value is .
maxConnections
- The maximum number of allowed open HTTP connections.public Optional<Long> getConnectionTtl()
Optional
that contains the expiration time (in milliseconds) for a connection in the connection pool.
When retrieving a connection from the pool to make a request, the total time that the connection
has been open is compared against this value. Connections which have been open for longer are
discarded, and if needed a new connection is created.
Tuning this setting down (together with an appropriately-low setting for Java's DNS cache TTL) ensures that your application will quickly rotate over to new IP addresses when the service begins announcing them through DNS, at the cost of having to re-establish new connections more frequently.
Default value is , which means connections do not expire.
public void setConnectionTtl(Long connectionTtl)
Tuning this setting down (together with an appropriately-low setting for Java's DNS cache TTL) ensures that your application will quickly rotate over to new IP addresses when the service begins announcing them through DNS, at the cost of having to re-establish new connections more frequently.
Default value is , which means connections do not expire.
connectionTtl
- The connection TTL, in millisecondspublic ConnectionConfiguration connectionTtl(long connectionTtl)
Tuning this setting down (together with an appropriately-low setting for Java's DNS cache TTL) ensures that your application will quickly rotate over to new IP addresses when the service begins announcing them through DNS, at the cost of having to re-establish new connections more frequently.
Default value is , which means connections do not expire.
connectionTtl
- The connection TTL, in millisecondspublic Optional<Long> getConnectionMaxIdleMillis()
Optional
which contains the maximum amount of time that an idle connection may sit in the connection
pool and still be eligible for reuse. When retrieving a connection from the pool to make a request,
the amount of time the connection has been idle is compared against this value. Connections
which have been idle for longer are discarded, and if needed a new connection is created.
Tuning this setting down reduces the likelihood of a race condition (wherein you begin sending a request down a connection which appears to be healthy, but before it arrives the service decides the connection has been idle for too long and closes it) at the cost of having to re-establish new connections more frequently.
Default value is .
public void setConnectionMaxIdleMillis(Long connectionMaxIdleMillis)
Tuning this setting down reduces the likelihood of a race condition (wherein you begin sending a request down a connection which appears to be healthy, but before it arrives the service decides the connection has been idle for too long and closes it) at the cost of having to re-establish new connections more frequently.
Default value is .
connectionMaxIdleMillis
- The connection maximum idle time, in millisecondspublic ConnectionConfiguration connectionMaxIdleMillis(long connectionMaxIdleMillis)
Tuning this setting down reduces the likelihood of a race condition (wherein you begin sending a request down a connection which appears to be healthy, but before it arrives the service decides the connection has been idle for too long and closes it) at the cost of having to re-establish new connections more frequently.
Default value is .
connectionMaxIdleMillis
- The connection maximum idle time, in millisecondspublic Optional<Boolean> isUseReaper()
IdleConnectionReaper
is to be started.
Default value is .
IdleConnectionReaper
is to be started.public void setUseReaper(Boolean useReaper)
IdleConnectionReaper
is to be started as a daemon thread.
Default value is .
useReaper
- The IdleConnectionReaper
is to be started as a daemon threadpublic ConnectionConfiguration useReaper(boolean useReaper)
IdleConnectionReaper
is to be started as a daemon thread.
Default value is .
useReaper
- The IdleConnectionReaper
is to be started as a daemon threadCopyright © 2017 Amazon Web Services, Inc. All Rights Reserved.