refactor: Clean up HttpEimsSender imports

This commit is contained in:
jade
2026-07-08 14:24:24 +09:00
parent a5d547b3f6
commit a4c6ea61a2

View File

@@ -7,6 +7,10 @@ import org.springframework.stereotype.Component;
import org.springframework.web.client.RestClient;
import java.util.Map;
import java.util.UUID;
import org.slf4j.MDC;
import org.springframework.http.client.SimpleClientHttpRequestFactory;
import io.shinhanlife.axhub.biz.mcp.tool.config.GlowCommunicationProperties;
@@ -22,7 +26,7 @@ public class HttpEimsSender implements EimsSender {
this.glowProps = glowProps;
// yml의 대내 MCI host, port, uri를 조합하여 EIMS 호출 주소 생성
this.eimsUrl = glowProps.getMci().getHost() + ":" + glowProps.getMci().getPort() + glowProps.getMci().getUri();
org.springframework.http.client.SimpleClientHttpRequestFactory factory = new org.springframework.http.client.SimpleClientHttpRequestFactory();
SimpleClientHttpRequestFactory factory = new SimpleClientHttpRequestFactory();
factory.setConnectTimeout(glowProps.getMci().getConnectionTimeout() * 1000);
factory.setReadTimeout(glowProps.getMci().getReadTimeout() * 1000);
this.restClient = RestClient.builder().requestFactory(factory).build();
@@ -39,8 +43,8 @@ public class HttpEimsSender implements EimsSender {
);
// 📊 4번 항목 적용: MDC에 저장된 traceId를 추출하여 HTTP Header(X-Trace-Id)로 전파
String traceId = org.slf4j.MDC.get("traceId");
if (traceId == null) traceId = "SYSTEM-GENERATED-" + java.util.UUID.randomUUID().toString();
String traceId = MDC.get("traceId");
if (traceId == null) traceId = "SYSTEM-GENERATED-" + UUID.randomUUID().toString();
return restClient.post()
.uri(eimsUrl)