Class CommonExternalServiceConnectionPoolTemplateProperties
Configures the default properties for dedicated Reactor Netty connection pools backing external
service WebClient communication.
External service integrations can (and sometimes should) utilize independent connection pools to prevent resource exhaustion and cascading failures during external dependency outages. These properties serve as a template providing reasonable defaults for all external connection configurations in a single centralized component. This makes it easy to apply global changes affecting all external clients simultaneously, while still allowing individual clients to override these settings as needed.
For integrations that don't need an isolated connection configuration, please see the default
shared pool instance described in CommonExternalServiceDefaultConnectionPoolProperties
and configured in
CommonExternalServiceConnectionAutoConfiguration.commonExtlSvcClientConnector(com.broadleafcommerce.common.extension.webclient.autoconfigure.external.CommonExternalServiceClientConnectorFactory, com.broadleafcommerce.common.extension.webclient.autoconfigure.external.CommonExternalServiceDefaultConnectionPoolProperties).
- Since:
- MicroExtensionCommon 3.0.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanbooleanHow long a connection may sit unused in the pool before it is evicted.The maximum absolute age of a pooled connection, after which it is evicted once its in-flight request completes.inthashCode()booleanWhether Reactor Netty should publish connection pool metrics for this pool.booleanDictates whether SSL verification should be disabled by default on connection configurations created byCommonExternalServiceClientConnectorFactory.voidsetMaxIdleTime(Duration maxIdleTime) How long a connection may sit unused in the pool before it is evicted.voidsetMaxLifeTime(Duration maxLifeTime) The maximum absolute age of a pooled connection, after which it is evicted once its in-flight request completes.voidsetMetricsEnabled(boolean metricsEnabled) Whether Reactor Netty should publish connection pool metrics for this pool.voidsetSslVerificationDisabled(boolean sslVerificationDisabled) Dictates whether SSL verification should be disabled by default on connection configurations created byCommonExternalServiceClientConnectorFactory.toString()
-
Constructor Details
-
CommonExternalServiceConnectionPoolTemplateProperties
public CommonExternalServiceConnectionPoolTemplateProperties()
-
-
Method Details
-
isMetricsEnabled
public boolean isMetricsEnabled()Whether Reactor Netty should publish connection pool metrics for this pool. When enabled, the following gauges are registered against Micrometer's global registry (which Spring Boot binds to the application's
MeterRegistryby default, viamanagement.metrics.use-global-registry):reactor.netty.connection.provider.total.connectionsreactor.netty.connection.provider.active.connectionsreactor.netty.connection.provider.idle.connectionsreactor.netty.connection.provider.pending.connectionsreactor.netty.connection.provider.max.connectionsreactor.netty.connection.provider.max.pending.connectionsreactor.netty.connection.provider.pending.connections.time
Each meter is tagged with
idandremote.address. Meters are registered lazily, as connections to a given remote address are first established. Requiresio.micrometer:micrometer-coreon the classpath; if it is absent, metrics are skipped with a warning rather than failing startup.- Returns:
- whether connection pool metrics are published
-
getMaxIdleTime
How long a connection may sit unused in the pool before it is evicted.nullleaves Reactor Netty's default in place (no limit).- Returns:
- the maximum idle time of a pooled connection
-
getMaxLifeTime
The maximum absolute age of a pooled connection, after which it is evicted once its in-flight request completes.nullleaves Reactor Netty's default in place (no limit, meaning keep-alive connections live indefinitely).- Returns:
- the maximum lifetime of a pooled connection
-
isSslVerificationDisabled
public boolean isSslVerificationDisabled()Dictates whether SSL verification should be disabled by default on connection configurations created by
CommonExternalServiceClientConnectorFactory.By default, SSL verification is enabled for external service communication, and should not be disabled. Typically, external service integrations communicate with public-facing entities that utilize valid, publicly-trusted SSL certificates (as opposed to internal hosts which may rely on self-signed certificates). Therefore, SSL verification should generally remain enabled to ensure secure communication.
Furthermore, in the rare circumstances where an integration does require customizing/disabling SSL, it should be configured for that integration specifically rather than toggling this global default. The property is only included to provide and flexibility in rare circumstances (such as testing) where globally disabling SSL verification may be desirable.
- Returns:
- Dictates whether SSL verification should be disabled.
-
setMetricsEnabled
public void setMetricsEnabled(boolean metricsEnabled) Whether Reactor Netty should publish connection pool metrics for this pool. When enabled, the following gauges are registered against Micrometer's global registry (which Spring Boot binds to the application's
MeterRegistryby default, viamanagement.metrics.use-global-registry):reactor.netty.connection.provider.total.connectionsreactor.netty.connection.provider.active.connectionsreactor.netty.connection.provider.idle.connectionsreactor.netty.connection.provider.pending.connectionsreactor.netty.connection.provider.max.connectionsreactor.netty.connection.provider.max.pending.connectionsreactor.netty.connection.provider.pending.connections.time
Each meter is tagged with
idandremote.address. Meters are registered lazily, as connections to a given remote address are first established. Requiresio.micrometer:micrometer-coreon the classpath; if it is absent, metrics are skipped with a warning rather than failing startup.- Parameters:
metricsEnabled- whether connection pool metrics are published
-
setMaxIdleTime
How long a connection may sit unused in the pool before it is evicted.nullleaves Reactor Netty's default in place (no limit).- Parameters:
maxIdleTime- the maximum idle time of a pooled connection
-
setMaxLifeTime
The maximum absolute age of a pooled connection, after which it is evicted once its in-flight request completes.nullleaves Reactor Netty's default in place (no limit, meaning keep-alive connections live indefinitely).- Parameters:
maxLifeTime- the maximum lifetime of a pooled connection
-
setSslVerificationDisabled
public void setSslVerificationDisabled(boolean sslVerificationDisabled) Dictates whether SSL verification should be disabled by default on connection configurations created by
CommonExternalServiceClientConnectorFactory.By default, SSL verification is enabled for external service communication, and should not be disabled. Typically, external service integrations communicate with public-facing entities that utilize valid, publicly-trusted SSL certificates (as opposed to internal hosts which may rely on self-signed certificates). Therefore, SSL verification should generally remain enabled to ensure secure communication.
Furthermore, in the rare circumstances where an integration does require customizing/disabling SSL, it should be configured for that integration specifically rather than toggling this global default. The property is only included to provide and flexibility in rare circumstances (such as testing) where globally disabling SSL verification may be desirable.
- Parameters:
disabled- Dictates whether SSL verification should be disabled.
-
equals
-
canEqual
-
hashCode
public int hashCode() -
toString
-