diff --git a/dap-was-lib/src/main/java/io/shinhanlife/dap/lib/adapter/aop/EimsMonitoringAspect.java b/dap-was-lib/src/main/java/io/shinhanlife/dap/lib/adapter/aop/EimsMonitoringAspect.java deleted file mode 100644 index bc2ff8a7..00000000 --- a/dap-was-lib/src/main/java/io/shinhanlife/dap/lib/adapter/aop/EimsMonitoringAspect.java +++ /dev/null @@ -1,63 +0,0 @@ -package io.shinhanlife.dap.lib.adapter.aop; - -import lombok.extern.slf4j.Slf4j; -import org.aspectj.lang.ProceedingJoinPoint; -import org.aspectj.lang.annotation.Around; -import org.aspectj.lang.annotation.Aspect; -import org.springframework.stereotype.Component; - -import java.util.Arrays; - -/** - * @package io.shinhanlife.dap.lib.adapter.aop - * @className EimsMonitoringAspect - * @description AX HUB 시스템 처리 클래스 - * @author 0986406 - * @create 2026.09.01 - *
- * ---------- 개정이력 ---------- - * 수정일 수정자 수정내용 - * ---------- -------- --------------------------- - * 2026.09.01 0986406 최초생성 - * - *- */ -@Slf4j -@Aspect -@Component -public class EimsMonitoringAspect { - - // 포인트컷: io.shinhanlife.dap.lib.adapter.sender 패키지 내의 EimsSender를 구현한 모든 클래스의 메서드를 타겟으로 지정합니다. - @Around("execution(* io.shinhanlife.dap.lib.adapter.sender.*EimsSender.*(..))") - public Object monitorEimsCommunication(ProceedingJoinPoint joinPoint) throws Throwable { - - // 1. 호출되는 클래스와 메서드 이름 추출 - String className = joinPoint.getTarget().getClass().getSimpleName(); - String methodName = joinPoint.getSignature().getName(); - Object[] args = joinPoint.getArgs(); // 파라미터 - - long startTime = System.currentTimeMillis(); - - // 2. [요청 로깅] EIMS망으로 요청이 나가기 직전 - log.info(" [EIMS 요청] {} - {}() | Params: {}", className, methodName, Arrays.toString(args)); - - try { - // 실제 레거시 통신 로직 실행 (이 코드가 없으면 통신이 진행되지 않습니다) - Object result = joinPoint.proceed(); - - // 3. [응답 로깅] 정상적으로 통신이 완료된 후 - long executionTime = System.currentTimeMillis() - startTime; - log.info("◀ [EIMS 응답] {} - {}() | 소요시간: {}ms | Result: {}", className, methodName, executionTime, result); - - return result; - - } catch (Exception e) { - // 4. [에러 로깅] 레거시 통신 중 장애(타임아웃 등) 발생 시 - long executionTime = System.currentTimeMillis() - startTime; - log.error(" [EIMS 에러] {} - {}() | 소요시간: {}ms | Error: {}", className, methodName, executionTime, e.getMessage()); - - // 에러를 삼키지 않고 다시 던져서 기존 예외 처리 로직(서킷 브레이커 등)이 작동하게 합니다. - throw e; - } - } -} \ No newline at end of file diff --git a/dap-was-lib/src/main/java/io/shinhanlife/dap/lib/adapter/exception/MciCommunicationException.java b/dap-was-lib/src/main/java/io/shinhanlife/dap/lib/adapter/exception/MciCommunicationException.java deleted file mode 100644 index 2e45f94a..00000000 --- a/dap-was-lib/src/main/java/io/shinhanlife/dap/lib/adapter/exception/MciCommunicationException.java +++ /dev/null @@ -1,26 +0,0 @@ -package io.shinhanlife.dap.lib.adapter.exception; - -/** - * @package io.shinhanlife.dap.lib.adapter.exception - * @className MciCommunicationException - * @description AX HUB 시스템 처리 클래스 - * @author 0986406 - * @create 2026.09.01 - *
- * ---------- 개정이력 ---------- - * 수정일 수정자 수정내용 - * ---------- -------- --------------------------- - * 2026.09.01 0986406 최초생성 - * - *- */ -public class MciCommunicationException extends RuntimeException { - - public MciCommunicationException(String message) { - super(message); - } - - public MciCommunicationException(String message, Throwable cause) { - super(message, cause); - } -} diff --git a/dap-was-lib/src/main/java/io/shinhanlife/dap/lib/adapter/sender/EaiEimsSender.java b/dap-was-lib/src/main/java/io/shinhanlife/dap/lib/adapter/sender/EaiEimsSender.java deleted file mode 100644 index 2ddbc1c2..00000000 --- a/dap-was-lib/src/main/java/io/shinhanlife/dap/lib/adapter/sender/EaiEimsSender.java +++ /dev/null @@ -1,104 +0,0 @@ -package io.shinhanlife.dap.lib.adapter.sender; - -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.dataformat.xml.XmlMapper; -import io.shinhanlife.dap.lib.adapter.support.TicketManager; -import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; -import org.springframework.kafka.core.KafkaTemplate; -import org.springframework.stereotype.Service; -import org.springframework.util.StopWatch; - -/** - * @package io.shinhanlife.dap.lib.adapter.sender - * @className EaiEimsSender - * @description AX HUB 시스템 처리 클래스 - * @author 0986406 - * @create 2026.09.01 - *
- * ---------- 개정이력 ---------- - * 수정일 수정자 수정내용 - * ---------- -------- --------------------------- - * 2026.09.01 0986406 최초생성 - * - *- */ -@Slf4j -@Service("eaiEimsSender") -@RequiredArgsConstructor -public class EaiEimsSender implements EimsSender { - - private final ObjectMapper jsonMapper; - private final XmlMapper xmlMapper; - - // 실전 코드: 스프링이 제공하는 카프카 템플릿 주입 - private final KafkaTemplate
- * ---------- 개정이력 ---------- - * 수정일 수정자 수정내용 - * ---------- -------- --------------------------- - * 2026.09.01 0986406 최초생성 - * - *- */ -public interface EimsSender { - // 프로토콜에 상관없이 이 메서드 하나로 통일합니다. - String send(String interfaceId, String payload) throws Exception; -} \ No newline at end of file diff --git a/dap-was-lib/src/main/java/io/shinhanlife/dap/lib/adapter/sender/HttpEimsSender.java b/dap-was-lib/src/main/java/io/shinhanlife/dap/lib/adapter/sender/HttpEimsSender.java deleted file mode 100644 index 9ba08a23..00000000 --- a/dap-was-lib/src/main/java/io/shinhanlife/dap/lib/adapter/sender/HttpEimsSender.java +++ /dev/null @@ -1,81 +0,0 @@ -package io.shinhanlife.dap.lib.adapter.sender; - -import lombok.extern.slf4j.Slf4j; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; -import org.springframework.stereotype.Component; -import org.springframework.web.client.RestClient; -import org.springframework.http.client.SimpleClientHttpRequestFactory; - -import java.util.Map; -import java.util.UUID; - -import org.slf4j.MDC; - -import io.shinhanlife.dap.lib.config.GlowCommunicationProperties; - -/** - * @package io.shinhanlife.dap.lib.adapter.sender - * @className HttpEimsSender - * @description AX HUB 시스템 처리 클래스 - * @author 0986406 - * @create 2026.09.01 - *
- * ---------- 개정이력 ---------- - * 수정일 수정자 수정내용 - * ---------- -------- --------------------------- - * 2026.09.01 0986406 최초생성 - * - *- */ -@Slf4j -@Component -public class HttpEimsSender implements EimsSender { - - private final RestClient restClient; - private final String eimsUrl; - private final GlowCommunicationProperties glowProps; - - public HttpEimsSender(GlowCommunicationProperties glowProps) { - this.glowProps = glowProps; - // yml의 대내 MCI host, port, uri를 조합하여 EIMS 호출 주소 생성 - this.eimsUrl = glowProps.getMci().getHost() + ":" + glowProps.getMci().getPort() + glowProps.getMci().getUri(); - - /* - *********************************************** 중요 ************************************************** - this.restClient = RestClient.create(); - 보통 금융권(신한라이프 등 은행/보험사)의 내부 레거시 시스템이나 MCI(Message Channel Integration) 솔루션은 HTTP/2를 기본으로 지원하지 않는 경우가 훨씬 많습니다. - *********************************************** 중요 ************************************************** - */ - - // 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 - public String send(String interfaceId, String payload) { - log.info(" [HTTP 모드] EIMS API 호출 중... URL: {}", eimsUrl); - - // EIMS가 요구하는 JSON 포맷으로 래핑해서 전송 (EIMS 규격에 따라 수정 가능) - Map
- * ---------- 개정이력 ---------- - * 수정일 수정자 수정내용 - * ---------- -------- --------------------------- - * 2026.09.01 0986406 최초생성 - * - *- */ -@Slf4j -@Component -public class JspFormEimsSender implements EimsSender { - - private final RestClient restClient; - private final String jspUrl; - - public JspFormEimsSender(@Value("${eims.jsp.form.url}") String jspUrl) { - this.jspUrl = jspUrl; - this.restClient = RestClient.builder().build(); - } - - @Override - public String send(String interfaceId, String payload) { - log.info(" [JSP Form 모드] 레거시 폼 데이터 전송 중... URL: {}", jspUrl); - - // 1. Form Data 조립 (HTML