Class CommonExternalServiceConnectionPoolTemplateProperties

java.lang.Object
com.broadleafcommerce.common.extension.webclient.autoconfigure.external.CommonExternalServiceConnectionPoolTemplateProperties

@ConfigurationProperties("broadleaf.common.external-webclient.connection-pool-template") public class CommonExternalServiceConnectionPoolTemplateProperties extends Object

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 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 MeterRegistry by default, via management.metrics.use-global-registry):

      • reactor.netty.connection.provider.total.connections
      • reactor.netty.connection.provider.active.connections
      • reactor.netty.connection.provider.idle.connections
      • reactor.netty.connection.provider.pending.connections
      • reactor.netty.connection.provider.max.connections
      • reactor.netty.connection.provider.max.pending.connections
      • reactor.netty.connection.provider.pending.connections.time

      Each meter is tagged with id and remote.address. Meters are registered lazily, as connections to a given remote address are first established. Requires io.micrometer:micrometer-core on the classpath; if it is absent, metrics are skipped with a warning rather than failing startup.

      Returns:
      whether connection pool metrics are published
    • getMaxIdleTime

      @Nullable public Duration getMaxIdleTime()
      How long a connection may sit unused in the pool before it is evicted. null leaves Reactor Netty's default in place (no limit).
      Returns:
      the maximum idle time of a pooled connection
    • getMaxLifeTime

      @Nullable public Duration getMaxLifeTime()
      The maximum absolute age of a pooled connection, after which it is evicted once its in-flight request completes. null leaves 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 MeterRegistry by default, via management.metrics.use-global-registry):

      • reactor.netty.connection.provider.total.connections
      • reactor.netty.connection.provider.active.connections
      • reactor.netty.connection.provider.idle.connections
      • reactor.netty.connection.provider.pending.connections
      • reactor.netty.connection.provider.max.connections
      • reactor.netty.connection.provider.max.pending.connections
      • reactor.netty.connection.provider.pending.connections.time

      Each meter is tagged with id and remote.address. Meters are registered lazily, as connections to a given remote address are first established. Requires io.micrometer:micrometer-core on 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

      public void setMaxIdleTime(@Nullable Duration maxIdleTime)
      How long a connection may sit unused in the pool before it is evicted. null leaves Reactor Netty's default in place (no limit).
      Parameters:
      maxIdleTime - the maximum idle time of a pooled connection
    • setMaxLifeTime

      public void setMaxLifeTime(@Nullable Duration maxLifeTime)
      The maximum absolute age of a pooled connection, after which it is evicted once its in-flight request completes. null leaves 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

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • canEqual

      protected boolean canEqual(Object other)
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object