实时通讯

This commit is contained in:
高保安
2025-12-15 11:46:00 +08:00
parent 7fb4bf94c4
commit 01ea7e15fa
53 changed files with 1755 additions and 135 deletions

View File

@@ -0,0 +1,21 @@
package com.realtime.config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.client.SimpleClientHttpRequestFactory;
import org.springframework.web.client.RestTemplate;
/**
* RestTemplate配置
*/
@Configuration
public class RestTemplateConfig {
@Bean
public RestTemplate restTemplate() {
SimpleClientHttpRequestFactory factory = new SimpleClientHttpRequestFactory();
factory.setConnectTimeout(10000); // 连接超时10秒
factory.setReadTimeout(30000); // 读取超时30秒
return new RestTemplate(factory);
}
}