style: fix inline FQCNs to proper imports to comply with team rules
This commit is contained in:
@@ -26,6 +26,7 @@ import org.springframework.core.ParameterizedTypeReference;
|
|||||||
import org.springframework.http.ResponseEntity;
|
import org.springframework.http.ResponseEntity;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.client.RestClient;
|
import org.springframework.web.client.RestClient;
|
||||||
|
import org.springframework.http.client.SimpleClientHttpRequestFactory;
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@RestController
|
@RestController
|
||||||
@@ -52,7 +53,7 @@ public class McpRouterController {
|
|||||||
this.gatewayFallbackProperties = gatewayFallbackProperties;
|
this.gatewayFallbackProperties = gatewayFallbackProperties;
|
||||||
|
|
||||||
// [수정됨] 1초 타임아웃을 강제하여 죽은 서버 대기로 인한 지연 방지
|
// [수정됨] 1초 타임아웃을 강제하여 죽은 서버 대기로 인한 지연 방지
|
||||||
org.springframework.http.client.SimpleClientHttpRequestFactory factory = new org.springframework.http.client.SimpleClientHttpRequestFactory();
|
SimpleClientHttpRequestFactory factory = new SimpleClientHttpRequestFactory();
|
||||||
factory.setConnectTimeout(1000); // 연결 시도 타임아웃 1초
|
factory.setConnectTimeout(1000); // 연결 시도 타임아웃 1초
|
||||||
factory.setReadTimeout(1000); // 응답 대기 타임아웃 1초
|
factory.setReadTimeout(1000); // 응답 대기 타임아웃 1초
|
||||||
|
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import org.springframework.beans.factory.annotation.Value;
|
|||||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
import org.springframework.web.client.RestClient;
|
import org.springframework.web.client.RestClient;
|
||||||
|
import org.springframework.http.client.SimpleClientHttpRequestFactory;
|
||||||
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
@@ -39,7 +40,13 @@ public class HttpEimsSender implements EimsSender {
|
|||||||
this.glowProps = glowProps;
|
this.glowProps = glowProps;
|
||||||
// yml의 대내 MCI host, port, uri를 조합하여 EIMS 호출 주소 생성
|
// yml의 대내 MCI host, port, uri를 조합하여 EIMS 호출 주소 생성
|
||||||
this.eimsUrl = glowProps.getMci().getHost() + ":" + glowProps.getMci().getPort() + glowProps.getMci().getUri();
|
this.eimsUrl = glowProps.getMci().getHost() + ":" + glowProps.getMci().getPort() + glowProps.getMci().getUri();
|
||||||
this.restClient = RestClient.builder().build();
|
|
||||||
|
// HTTP/2 통신 시 Stream Cancelled(RST_STREAM) 에러 방지를 위해 HTTP/1.1 전용 Factory 사용
|
||||||
|
SimpleClientHttpRequestFactory factory = new SimpleClientHttpRequestFactory();
|
||||||
|
factory.setConnectTimeout(3000);
|
||||||
|
factory.setReadTimeout(5000);
|
||||||
|
|
||||||
|
this.restClient = RestClient.builder().requestFactory(factory).build();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import com.fasterxml.jackson.core.type.TypeReference;
|
|||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
@@ -41,7 +42,7 @@ public abstract class AbstractMcpToolService {
|
|||||||
/**
|
/**
|
||||||
* 레거시 시스템을 호출하고 공통 처리(PII 마스킹 등)를 수행합니다. (스펙 지정 가능)
|
* 레거시 시스템을 호출하고 공통 처리(PII 마스킹 등)를 수행합니다. (스펙 지정 가능)
|
||||||
*/
|
*/
|
||||||
protected Map<String, Object> executeLegacy(String routingType, String interfaceId, Object inputData, java.util.List<Map<String, Object>> spec) {
|
protected Map<String, Object> executeLegacy(String routingType, String interfaceId, Object inputData, List<Map<String, Object>> spec) {
|
||||||
Map<String, Object> inputMap;
|
Map<String, Object> inputMap;
|
||||||
if (inputData == null) {
|
if (inputData == null) {
|
||||||
inputMap = new HashMap<>();
|
inputMap = new HashMap<>();
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import io.shinhanlife.axhub.biz.mcp.tool.dto.SampleStringReq;
|
|||||||
import io.shinhanlife.glow.util.GlowMciParser;
|
import io.shinhanlife.glow.util.GlowMciParser;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @package io.shinhanlife.axhub.biz.mcp.tool.service
|
* @package io.shinhanlife.axhub.biz.mcp.tool.service
|
||||||
@@ -37,7 +38,7 @@ public class SampleStringToolService extends AbstractMcpToolService {
|
|||||||
public Object execute(SampleStringReq req) {
|
public Object execute(SampleStringReq req) {
|
||||||
// 1. EIMS(Legacy)를 통해 원본 고정 길이 문자열을 받아옵니다.
|
// 1. EIMS(Legacy)를 통해 원본 고정 길이 문자열을 받아옵니다.
|
||||||
// 스펙에 mciFormat = STRING 힌트를 주어 전문 통신으로 자동 분기되게 합니다.
|
// 스펙에 mciFormat = STRING 힌트를 주어 전문 통신으로 자동 분기되게 합니다.
|
||||||
java.util.List<Map<String, Object>> spec = java.util.List.of(
|
List<Map<String, Object>> spec = List.of(
|
||||||
Map.of("mciFormat", "STRING")
|
Map.of("mciFormat", "STRING")
|
||||||
);
|
);
|
||||||
Map<String, Object> result = executeLegacy("MCI", "TRGM_001", req, spec);
|
Map<String, Object> result = executeLegacy("MCI", "TRGM_001", req, spec);
|
||||||
|
|||||||
Reference in New Issue
Block a user