Class PoolOptions
java.lang.Object
io.vertx.core.http.PoolOptions
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intThe default maximum number of connections an HTTP/2 client will pool = 1static final intThe default maximum number of connections an HTTP/3 client will pool = 1static final intThe default maximum number of HTTP/1 connections a client will pool = 5static final intDefault max wait queue size = -1 (unbounded)static final intDefault maximum pooled connection lifetime = 0 (no maximum)static final TimeUnitDefault maximum pooled connection lifetime unit = secondsstatic final intDefault pool cleaner period = 1000 ms (1 second)static final intDefault pool event loop size = 0 (reuse current event-loop) -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructorPoolOptions(PoolOptions other) Copy constructorPoolOptions(JsonObject json) Constructor to create an options from JSON -
Method Summary
Modifier and TypeMethodDescriptionintintintGet the maximum pool size for HTTP/1.x connectionsintGet the maximum pool size for HTTP/2 connectionsintGet the maximum pool size for HTTP/3 connectionsintintReturns the maximum wait queue sizesetCleanerPeriod(int cleanerPeriod) Set the connection pool cleaner period in milli seconds, a non positive value disables expiration checks and connections will remain in the pool until they are closed.setEventLoopSize(int eventLoopSize) Set the number of event-loop the pool use.setHttp1MaxSize(int http1MaxSize) Set the maximum pool size for HTTP/1.x connectionssetHttp2MaxSize(int max) Set the maximum pool size for HTTP/2 connectionssetHttp3MaxSize(int max) Set the maximum pool size for HTTP/3 connectionssetMaxLifetime(int maxLifetime) Establish a max lifetime for pooled connections, a value of zero disables the maximum lifetime.setMaxLifetimeUnit(TimeUnit maxLifetimeUnit) Establish a max lifetime unit for pooled connections.setMaxWaitQueueSize(int maxWaitQueueSize) Set the maximum requests allowed in the wait queue, any requests beyond the max size will result in a ConnectionPoolTooBusyException.toJson()
-
Field Details
-
DEFAULT_MAX_POOL_SIZE
public static final int DEFAULT_MAX_POOL_SIZEThe default maximum number of HTTP/1 connections a client will pool = 5- See Also:
-
DEFAULT_HTTP2_MAX_POOL_SIZE
public static final int DEFAULT_HTTP2_MAX_POOL_SIZEThe default maximum number of connections an HTTP/2 client will pool = 1- See Also:
-
DEFAULT_HTTP3_MAX_POOL_SIZE
public static final int DEFAULT_HTTP3_MAX_POOL_SIZEThe default maximum number of connections an HTTP/3 client will pool = 1- See Also:
-
DEFAULT_MAX_WAIT_QUEUE_SIZE
public static final int DEFAULT_MAX_WAIT_QUEUE_SIZEDefault max wait queue size = -1 (unbounded)- See Also:
-
DEFAULT_MAXIMUM_LIFETIME
public static final int DEFAULT_MAXIMUM_LIFETIMEDefault maximum pooled connection lifetime = 0 (no maximum)- See Also:
-
DEFAULT_MAXIMUM_LIFETIME_TIME_UNIT
Default maximum pooled connection lifetime unit = seconds -
DEFAULT_POOL_CLEANER_PERIOD
public static final int DEFAULT_POOL_CLEANER_PERIODDefault pool cleaner period = 1000 ms (1 second)- See Also:
-
DEFAULT_POOL_EVENT_LOOP_SIZE
public static final int DEFAULT_POOL_EVENT_LOOP_SIZEDefault pool event loop size = 0 (reuse current event-loop)- See Also:
-
-
Constructor Details
-
PoolOptions
public PoolOptions()Default constructor -
PoolOptions
-
PoolOptions
Constructor to create an options from JSON- Parameters:
json- the JSON
-
-
Method Details
-
getHttp1MaxSize
public int getHttp1MaxSize()Get the maximum pool size for HTTP/1.x connections- Returns:
- the maximum pool size
-
setHttp1MaxSize
Set the maximum pool size for HTTP/1.x connections- Parameters:
http1MaxSize- the maximum pool size- Returns:
- a reference to this, so the API can be used fluently
-
getHttp2MaxSize
public int getHttp2MaxSize()Get the maximum pool size for HTTP/2 connections- Returns:
- the maximum pool size
-
setHttp2MaxSize
Set the maximum pool size for HTTP/2 connections- Parameters:
max- the maximum pool size- Returns:
- a reference to this, so the API can be used fluently
-
getHttp3MaxSize
public int getHttp3MaxSize()Get the maximum pool size for HTTP/3 connections- Returns:
- the maximum pool size
-
setHttp3MaxSize
Set the maximum pool size for HTTP/3 connections- Parameters:
max- the maximum pool size- Returns:
- a reference to this, so the API can be used fluently
-
getMaxLifetimeUnit
- Returns:
- the pooled connection max lifetime unit
-
setMaxLifetimeUnit
Establish a max lifetime unit for pooled connections.- Parameters:
maxLifetimeUnit- pooled connection max lifetime unit- Returns:
- a reference to this, so the API can be used fluently
-
getMaxLifetime
public int getMaxLifetime()- Returns:
- pooled connection max lifetime
-
setMaxLifetime
Establish a max lifetime for pooled connections, a value of zero disables the maximum lifetime.- Parameters:
maxLifetime- the pool connection max lifetime- Returns:
- a reference to this, so the API can be used fluently
-
getCleanerPeriod
public int getCleanerPeriod()- Returns:
- the connection pool cleaner period in ms.
-
setCleanerPeriod
Set the connection pool cleaner period in milli seconds, a non positive value disables expiration checks and connections will remain in the pool until they are closed.- Parameters:
cleanerPeriod- the pool cleaner period- Returns:
- a reference to this, so the API can be used fluently
-
getEventLoopSize
public int getEventLoopSize()- Returns:
- the max number of event-loop a pool will use, the default value is
0which implies to reuse the current event-loop
-
setEventLoopSize
Set the number of event-loop the pool use.- when the size is
0, the client pool will use the current event-loop - otherwise the client will create and use its own event loop
0.- Parameters:
eventLoopSize- the new size- Returns:
- a reference to this, so the API can be used fluently
- when the size is
-
setMaxWaitQueueSize
Set the maximum requests allowed in the wait queue, any requests beyond the max size will result in a ConnectionPoolTooBusyException. If the value is set to a negative number then the queue will be unbounded.- Parameters:
maxWaitQueueSize- the maximum number of waiting requests- Returns:
- a reference to this, so the API can be used fluently
-
getMaxWaitQueueSize
public int getMaxWaitQueueSize()Returns the maximum wait queue size- Returns:
- the maximum wait queue size
-
toJson
-