Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RestTemplateAutoConfigure中使用Timeout.ofMicroseconds方法造成read time out #73

Open
henghengdh opened this issue Nov 27, 2024 · 0 comments

Comments

@henghengdh
Copy link

RestTemplateAutoConfigure中

ConnectionConfig connectConfig = ConnectionConfig.custom()
// 读超时
.setSocketTimeout(Timeout.ofMicroseconds(restTemplateProperties.getReadTimeout()))
// 链接超时
.setConnectTimeout(Timeout.ofMicroseconds(restTemplateProperties.getConnectTimeout()))
.build();
connectionManager.setDefaultConnectionConfig(connectConfig);

    这段代码使用的Timeout.ofMicroseconds方法是不是不对,时间太短造成read time out,应该改成ofMilliseconds这个方法
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant