Skip to content

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

Description

@henghengdh

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这个方法

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions