|
@@ -2,6 +2,7 @@ package com.uas.erp.schedular.config;
|
|
|
|
|
|
import org.springframework.context.annotation.Bean;
|
|
|
import org.springframework.context.annotation.Configuration;
|
|
|
+import org.springframework.http.client.SimpleClientHttpRequestFactory;
|
|
|
import org.springframework.http.converter.HttpMessageConverter;
|
|
|
import org.springframework.http.converter.StringHttpMessageConverter;
|
|
|
import org.springframework.web.client.RestTemplate;
|
|
@@ -54,7 +55,9 @@ public class WebMvcConfig extends WebMvcConfigurerAdapter {
|
|
|
|
|
|
@Bean
|
|
|
public RestTemplate restTemplate() {
|
|
|
- RestTemplate restTemplate = new RestTemplate();
|
|
|
+ SimpleClientHttpRequestFactory requestFactory = new SimpleClientHttpRequestFactory();
|
|
|
+ requestFactory.setReadTimeout(120000); //@add xiaost 20200226 设置数据读取超时时长为2分钟
|
|
|
+ RestTemplate restTemplate = new RestTemplate(requestFactory);
|
|
|
restTemplate.getMessageConverters().add(0, responseBodyConverter());
|
|
|
return restTemplate;
|
|
|
}
|