Class CommonExternalServiceConnectionAutoConfiguration
Analogous to the configuration in CommonInternalServiceConnectionAutoConfiguration, but
opinionated for external communication.
- Since:
- MicroExtensionCommon 3.0.0
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.http.client.reactive.ClientHttpConnectorcommonExtlSvcClientConnector(CommonExternalServiceClientConnectorFactory connectorFactory, CommonExternalServiceDefaultConnectionPoolProperties defaultConnectionPoolProperties) CommonExternalServiceClientConnectorFactoryprovides a starting template for external service integrations to define their own isolated connection pools.commonExtlSvcClientConnectorFactory(CommonExternalServiceConnectionPoolTemplateProperties poolProperties) Declares the default central factory bean that services can use to construct isolated, independentClientHttpConnectorandHttpClientinstances for external communications.
-
Constructor Details
-
CommonExternalServiceConnectionAutoConfiguration
public CommonExternalServiceConnectionAutoConfiguration()
-
-
Method Details
-
commonExtlSvcClientConnectorFactory
@Bean(name="commonExtlSvcClientConnectorFactory") @ConditionalOnMissingBean(name="commonExtlSvcClientConnectorFactory") public CommonExternalServiceClientConnectorFactory commonExtlSvcClientConnectorFactory(CommonExternalServiceConnectionPoolTemplateProperties poolProperties) Declares the default central factory bean that services can use to construct isolated, independentClientHttpConnectorandHttpClientinstances for external communications.- Parameters:
poolProperties- the global connection pool tuning defaults- Returns:
- the centralized factory bean for building external service client connection providers
-
commonExtlSvcClientConnector
@Bean(name="commonExtlSvcClientConnector") @ConditionalOnMissingBean(name="commonExtlSvcClientConnector") public org.springframework.http.client.reactive.ClientHttpConnector commonExtlSvcClientConnector(@Qualifier("commonExtlSvcClientConnectorFactory") CommonExternalServiceClientConnectorFactory connectorFactory, CommonExternalServiceDefaultConnectionPoolProperties defaultConnectionPoolProperties) CommonExternalServiceClientConnectorFactoryprovides a starting template for external service integrations to define their own isolated connection pools. However, in many cases, integrations may not require a high degree of isolation and can simplify the overall configuration and resource footprint by sharing the same underlying connection pool. This bean is offered as the designated defaultClientHttpConnectorinstance for this purpose.Note that by default, every
HttpClient.create()in the JVM shares Reactor Netty's anonymous globalHttpResourcespool, which has metrics disabled.This bean, which leverages an explicitly named pool, makes the
reactor.netty.connection.provider.*meters possible, allowing observation of outbound connection saturation for a given service.As a result, it is strongly recommended that any WebClient configurations that are currently leveraging the anonymous default pool switch to this as a backward compatible upgrade to centralized observability and configurability.
- Parameters:
connectorFactory- the factory bean to build external connectors- Returns:
- a default, fallback client HTTP connector
-