Merge pull request '[KC-108] resttemplate 설정 변경' (#199) from feat/infer_dev_260107 into develop

Reviewed-on: https://kamco.gitea.gs.dabeeo.com/dabeeo/kamco-dabeeo-backoffice/pulls/199
This commit is contained in:
2026-01-12 18:21:41 +09:00
2 changed files with 11 additions and 7 deletions

View File

@@ -1,21 +1,24 @@
package com.kamco.cd.kamcoback.config.resttemplate;
import java.time.Duration;
import java.util.List;
import java.net.Proxy;
import lombok.extern.log4j.Log4j2;
import org.springframework.boot.web.client.RestTemplateBuilder;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.client.SimpleClientHttpRequestFactory;
import org.springframework.web.client.RestTemplate;
@Log4j2
@Configuration
public class RestTemplateConfig {
@Bean
public RestTemplate restTemplate(RestTemplateBuilder builder) {
return builder
.connectTimeout(Duration.ofSeconds(2))
.readTimeout(Duration.ofSeconds(3))
.additionalInterceptors(List.of(new RetryInterceptor()))
.build();
SimpleClientHttpRequestFactory f = new SimpleClientHttpRequestFactory();
f.setProxy(Proxy.NO_PROXY); // 시스템/환경 프록시 무시
f.setConnectTimeout(2000);
f.setReadTimeout(3000);
return builder.requestFactory(() -> f).additionalInterceptors(new RetryInterceptor()).build();
}
}

View File

@@ -215,6 +215,7 @@ public class InferenceResultService {
HttpHeaders headers = new HttpHeaders();
headers.setContentType(MediaType.APPLICATION_JSON);
headers.setAccept(List.of(MediaType.APPLICATION_JSON));
ExternalCallResult result =
externalHttpClient.call(inferenceUrl, HttpMethod.POST, dto, headers);