@FunctionalInterface public interface ConnectionProvider extends Disposable
ConnectionProvider will produce Connection| Modifier and Type | Interface and Description | 
|---|---|
| static interface  | ConnectionProvider.AllocationStrategy<A extends ConnectionProvider.AllocationStrategy<A>> | 
| static class  | ConnectionProvider.BuilderBuild a  ConnectionProviderto cache and reuse a fixed maximum number ofConnection. | 
| static interface  | ConnectionProvider.ConnectionMetadata | 
| static class  | ConnectionProvider.ConnectionPoolSpec<SPEC extends ConnectionProvider.ConnectionPoolSpec<SPEC>>Configuration for a connection pool. | 
| static class  | ConnectionProvider.HostSpecificSpecConfiguration for a connection pool per remote host. | 
| static interface  | ConnectionProvider.MeterRegistrarA strategy to register which metrics are collected in a particular connection pool. | 
Disposable.Composite, Disposable.Swap| Modifier and Type | Field and Description | 
|---|---|
| static long | DEFAULT_POOL_ACQUIRE_TIMEOUTDefault acquisition timeout (milliseconds) before error. | 
| static String | DEFAULT_POOL_LEASING_STRATEGYDefault leasing strategy (fifo, lifo), fallback to fifo. | 
| static int | DEFAULT_POOL_MAX_CONNECTIONSDefault max connections. | 
| static long | DEFAULT_POOL_MAX_IDLE_TIMEDefault max idle time, fallback - max idle time is not specified. | 
| static long | DEFAULT_POOL_MAX_LIFE_TIMEDefault max life time, fallback - max life time is not specified. | 
| static String | LEASING_STRATEGY_FIFOThe connection selection is first in, first out. | 
| static String | LEASING_STRATEGY_LIFOThe connection selection is last in, first out. | 
| Modifier and Type | Method and Description | 
|---|---|
| Mono<? extends Connection> | acquire(TransportConfig config,
       ConnectionObserver connectionObserver,
       Supplier<? extends SocketAddress> remoteAddress,
       AddressResolverGroup<?> resolverGroup)Return an existing or new  Connectionon subscribe. | 
| static ConnectionProvider.Builder | builder(String name)Creates a builder for  ConnectionProvider | 
| static ConnectionProvider | create(String name)Create a new  ConnectionProviderto cache and reuse a fixed maximum
 number ofConnection. | 
| static ConnectionProvider | create(String name,
      int maxConnections)Create a new  ConnectionProviderto cache and reuse a fixed maximum
 number ofConnection. | 
| static ConnectionProvider | create(String name,
      int maxConnections,
      boolean metricsEnabled)Create a new  ConnectionProviderto cache and reuse a fixed maximum
 number ofConnection. | 
| default void | dispose()Dispose this ConnectionProvider. | 
| default Mono<Void> | disposeLater()Returns a Mono that triggers the disposal of the ConnectionProvider when subscribed to. | 
| default void | disposeWhen(SocketAddress remoteAddress)Dispose all connection pools for the specified remote address. | 
| default int | maxConnections()Returns the maximum number of connections before starting pending | 
| default Map<SocketAddress,Integer> | maxConnectionsPerHost()Returns the maximum number of connections per host before starting pending | 
| default ConnectionProvider.Builder | mutate()Returns a builder to mutate properties of this  ConnectionProvider | 
| default String | name()Returns  ConnectionProvidername used for metrics | 
| static ConnectionProvider | newConnection()Return a  ConnectionProviderthat will always create a newConnection. | 
isDisposedstatic final int DEFAULT_POOL_MAX_CONNECTIONS
static final long DEFAULT_POOL_ACQUIRE_TIMEOUT
static final long DEFAULT_POOL_MAX_IDLE_TIME
static final long DEFAULT_POOL_MAX_LIFE_TIME
static final String LEASING_STRATEGY_FIFO
static final String LEASING_STRATEGY_LIFO
static final String DEFAULT_POOL_LEASING_STRATEGY
static ConnectionProvider.Builder builder(String name)
ConnectionProvidername - ConnectionProvider namestatic ConnectionProvider newConnection()
ConnectionProvider that will always create a new
 Connection.ConnectionProvider that will always create a new
 Connection.static ConnectionProvider create(String name)
ConnectionProvider to cache and reuse a fixed maximum
 number of Connection.
 A Fixed ConnectionProvider will open up to the given max number of
 processors observed by this jvm (minimum 4).
 Further connections will be pending acquisition until DEFAULT_POOL_ACQUIRE_TIMEOUT
 and the default pending acquisition max count will be 500.
name - the connection pool nameConnectionProvider to cache and reuse a fixed maximum
 number of Connectionstatic ConnectionProvider create(String name, int maxConnections)
ConnectionProvider to cache and reuse a fixed maximum
 number of Connection.
 A Fixed ConnectionProvider will open up to the given max connection value.
 Further connections will be pending acquisition until DEFAULT_POOL_ACQUIRE_TIMEOUT
 and the default pending acquisition max count will be 2 * max connections value.
name - the connection pool namemaxConnections - the maximum number of connections before starting pending
 acquisition on existing onesConnectionProvider to cache and reuse a fixed maximum
 number of Connectionstatic ConnectionProvider create(String name, int maxConnections, boolean metricsEnabled)
ConnectionProvider to cache and reuse a fixed maximum
 number of Connection.
 A Fixed ConnectionProvider will open up to the given max connection value.
 Further connections will be pending acquisition until DEFAULT_POOL_ACQUIRE_TIMEOUT
 and the default pending acquisition max count will be 2 * max connections value.
name - the connection pool namemaxConnections - the maximum number of connections before starting pending
 acquisition on existing onesmetricsEnabled - true enables metrics collection; false disables itConnectionProvider to cache and reuse a fixed maximum
 number of ConnectionMono<? extends Connection> acquire(TransportConfig config, ConnectionObserver connectionObserver, @Nullable Supplier<? extends SocketAddress> remoteAddress, @Nullable AddressResolverGroup<?> resolverGroup)
Connection on subscribe.config - the transport configurationconnectionObserver - the ConnectionObserverremoteAddress - the SocketAddress to connect toresolverGroup - the resolver which will resolve the address of the unresolved named addressMono of Connectiondefault void disposeWhen(SocketAddress remoteAddress)
 This method has NOOP default implementation.
 ConnectionProvider implementations may decide to provide more specific implementation.
remoteAddress - the remote addressdefault void dispose()
disposeLater() when you need to observe the final
 status of the operation, combined with Mono.block()
 if you need to synchronously wait for the underlying resources to be disposed.dispose in interface Disposabledefault Mono<Void> disposeLater()
 This method has NOOP default implementation.
 ConnectionProvider implementations may decide to provide more specific implementation.
default int maxConnections()
@Nullable default Map<SocketAddress,Integer> maxConnectionsPerHost()
@Nullable default ConnectionProvider.Builder mutate()
ConnectionProviderConnectionProvider@Nullable default String name()
ConnectionProvider name used for metricsConnectionProvider name used for metrics