Closed youngzil closed 3 months ago
The recent changes enhance the RestTemplateFactory
and PortalConfig
classes by integrating a connection management feature, allowing configuration of the maximum connection pool and connections per route for HTTP requests. This optimization aims to improve performance and resource management, addressing limitations observed during high-load scenarios in the Apollo portal.
File Path | Change Summary |
---|---|
apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/component/RestTemplateFactory.java |
Implemented a PoolingHttpClientConnectionManager to optimize HTTP connection management. |
apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/component/config/PortalConfig.java |
Added connectPoolMaxTotal() and connectPoolMaxPerRoute() methods for customizable connection settings. |
CHANGES.md |
Documented the new feature supporting connection pool configuration for the RestTemplate client. |
sequenceDiagram
participant User
participant PortalConfig
participant RestTemplateFactory
participant ConnectionManager
User->>PortalConfig: Request config values
PortalConfig-->>User: Return connectPoolMaxTotal() and connectPoolMaxPerRoute()
User->>RestTemplateFactory: Create RestTemplate with config
RestTemplateFactory->>ConnectionManager: Set connection limits
ConnectionManager-->>RestTemplateFactory: Connection pool ready
Objective | Addressed | Explanation |
---|---|---|
Support configuration of HTTP max connection pool and per route size (#5199) | ✅ | |
Resolve high load performance issues by optimizing connection management | ✅ |
🐰 In the portal where bunnies hop,
New connections bloom, never stop!
Pooling brings joy, in a swift ballet,
HTTP flows free, come what may!
Hooray for the changes, let’s cheer and play! 🎉
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅
Please complete the CLA by following the instructions provided by the CLA bot. Once done, you may proceed to refresh the codebase and update the CHANGES.md file.
I have read the CLA Document and I hereby sign the CLA
What's the purpose of this PR
Portal 模块 RestTemplate 支持配置 HTTP最大连接池和每个路由的连接大小 详见 #5199
Which issue(s) this PR fixes:
Fixes #5199
Brief changelog
support portal restTemplate Client connection pool config
Follow this checklist to help us incorporate your contribution quickly and easily:
mvn clean test
to make sure this pull request doesn't break anything.CHANGES
log.Summary by CodeRabbit
New Features
Documentation