Skip to content

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

@henghengdh

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

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