Closed larry4xie closed 2 months ago
The changes involve enhancing the Apollo Portal's RestTemplate component to support configurable connection lifetimes. This is achieved by adding a new configuration option in PortalConfig
and utilizing it to set the ConnectionTimeToLive
for the CloseableHttpClient
used by the RestTemplateFactory. This update aims to improve the resilience of the service discovery mechanism under network fault conditions.
File Path | Change Summary |
---|---|
.../apollo/portal/component/RestTemplateFactory.java |
Added TimeUnit import; modified CloseableHttpClient creation to use connectionTimeToLive from PortalConfig . |
.../apollo/portal/component/config/PortalConfig.java |
Added connectionTimeToLive() method to return api.connectionTimeToLive property value. |
ConnectionTimeToLive
configurability in the Portal module to address network fault scenarios. This PR directly implements the requested feature, suggesting a solution to the problem outlined.As the moon whispers to the night, a change takes flight, In the land of Apollo, where configurations shine bright. 🐇 A rabbit hopped, code in paw, setting connections to renew, 🌌 Under starlit skies, a resilience grew. Through the network's weave, they dance and weave, A tale of connections, in which we believe. So here's to changes, both big and small, a toast, For every packet lost, may resilience be our boast.
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 ✍️ ✅
Thanks for your contribution. I have a question. Is there any mechanism like RestTemplate timeout reconnect?
@shoothzj 丢包会产生 read timeout, 但是不同于 TCP FIN or RST, RestTemplate 不会重建连接,还是使用的被故障注入的 IP
I have read the CLA Document and I hereby sign the CLA
希望 Portal 模块 RestTemplateFactory 支持配置 ConnectionTimeToLive,详见 #5120
Summary by CodeRabbit