Package io.micronaut.http.client
Enum Class HttpClientConfiguration.ConnectionPoolConfiguration.ConnectionLocality
java.lang.Object
java.lang.Enum<HttpClientConfiguration.ConnectionPoolConfiguration.ConnectionLocality>
io.micronaut.http.client.HttpClientConfiguration.ConnectionPoolConfiguration.ConnectionLocality
- All Implemented Interfaces:
Serializable
,Comparable<HttpClientConfiguration.ConnectionPoolConfiguration.ConnectionLocality>
,Constable
- Enclosing class:
- HttpClientConfiguration.ConnectionPoolConfiguration
public static enum HttpClientConfiguration.ConnectionPoolConfiguration.ConnectionLocality
extends Enum<HttpClientConfiguration.ConnectionPoolConfiguration.ConnectionLocality>
Options for
HttpClientConfiguration.ConnectionPoolConfiguration.connectionLocality
.- Since:
- 4.8.0
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantDescriptionSame asENFORCED_IF_SAME_GROUP
, but if a request is made from outside the event loop group of the client, fail a request.If a request is made from an event loop, and a connection is already in the pool from that same event loop, use that connection.Do not consider locality when selecting a connection.If a request is made from an event loop, and a connection is already in the pool from that same event loop, prefer using that connection. -
Method Summary
Modifier and TypeMethodDescriptionReturns the enum constant of this class with the specified name.values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
IGNORE
Do not consider locality when selecting a connection. -
PREFERRED
public static final HttpClientConfiguration.ConnectionPoolConfiguration.ConnectionLocality PREFERREDIf a request is made from an event loop, and a connection is already in the pool from that same event loop, prefer using that connection. When a new connection needs to be created, also prefer the current event loop. -
ENFORCED_IF_SAME_GROUP
public static final HttpClientConfiguration.ConnectionPoolConfiguration.ConnectionLocality ENFORCED_IF_SAME_GROUPIf a request is made from an event loop, and a connection is already in the pool from that same event loop, use that connection. Otherwise, force creating a new connection on the same event loop. Please ensure that settings such asHttpClientConfiguration.ConnectionPoolConfiguration.maxPendingConnections
are also high enough to create new connections. -
ENFORCED_ALWAYS
public static final HttpClientConfiguration.ConnectionPoolConfiguration.ConnectionLocality ENFORCED_ALWAYSSame asENFORCED_IF_SAME_GROUP
, but if a request is made from outside the event loop group of the client, fail a request. Note that there is no guarantee that the offending request is the only request seeing a failure, so the exception should only be used as a warning that you are using the client in a way that you did not intend.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
public static HttpClientConfiguration.ConnectionPoolConfiguration.ConnectionLocality valueOf(String name) Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum class has no constant with the specified nameNullPointerException
- if the argument is null
-