Inject Pooling Connection Manager - #2025
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces support for a shared PoolingHttpClientConnectionManager in AdyenHttpClient by adding a new constructor and updating the HTTP client builder to use the shared manager when provided. The review feedback recommends declaring the sharedConnectionManager field as final to guarantee thread safety and safe publication. Additionally, it suggests adding Javadoc documentation to clarify that custom SSL configurations and connection-level timeouts from the Config class are ignored or must be pre-configured when using a shared connection manager.
|
Thanks for the contribution @danielrohe . Injecting a connection manager is valuable for advanced use cases such as Micrometer telemetry, pool sharing, and lower-level Apache configuration. Before merging, could you please:
In a new issue we will expose in the |
In a microservices especially based on Spring Boot it is often useful to inject a shared
PoolingHttpClientConnectionManagerinto all clients including the AdyenHttpClient. The benefits areCreated the no-args constructor for backward compatibility and added one for injecting a shared
PoolingHttpClientConnectionManager. Adjusted thecreateHttpClientWithSocketFactorymethod to consider the shared connetction pool manager if necessary.