diff --git a/axhub-gateway/src/main/java/io/shinhanlife/axhub/biz/mcp/gateway/controller/MciMockController.java b/axhub-gateway/src/main/java/io/shinhanlife/axhub/biz/mcp/gateway/controller/MciMockController.java new file mode 100644 index 0000000..1f67945 --- /dev/null +++ b/axhub-gateway/src/main/java/io/shinhanlife/axhub/biz/mcp/gateway/controller/MciMockController.java @@ -0,0 +1,37 @@ +package io.shinhanlife.axhub.biz.mcp.gateway.controller; + +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RestController; +import java.util.Map; + +@RestController +public class MciMockController { + + @PostMapping("/mciSend") + public Map mciSend() { + return Map.of( + "resCode", "0000", + "resMsg", "정상 처리되었습니다.", + "data", Map.of( + "status", "SUCCESS", + "mock", true, + "protocol", "HTTP/2 (h2c)", + "detail", "가짜 응답 서버(HTTP/2 WebFlux)에서 내려주는 대내(MCI) 샘플 데이터입니다." + ) + ); + } + + @PostMapping("/extmci") + public Map extmci() { + return Map.of( + "resCode", "0000", + "resMsg", "정상 처리되었습니다.", + "data", Map.of( + "status", "SUCCESS", + "mock", true, + "protocol", "HTTP/2 (h2c)", + "detail", "가짜 응답 서버(HTTP/2 WebFlux)에서 내려주는 대외(EXTMCI) 샘플 데이터입니다." + ) + ); + } +} diff --git a/axhub-gateway/src/main/resources/application.properties b/axhub-gateway/src/main/resources/application.properties index f03eb7c..64a97a5 100644 --- a/axhub-gateway/src/main/resources/application.properties +++ b/axhub-gateway/src/main/resources/application.properties @@ -1,5 +1,6 @@ spring.application.name=axhub-admin server.port=8081 +server.http2.enabled=true # 기본적으로 local 환경을 실행 spring.profiles.active=local diff --git a/axhub-tool-core/src/main/java/io/shinhanlife/axhub/biz/mcp/adapter/sender/HttpEimsSender.java b/axhub-tool-core/src/main/java/io/shinhanlife/axhub/biz/mcp/adapter/sender/HttpEimsSender.java index 17dcbb9..7f83825 100644 --- a/axhub-tool-core/src/main/java/io/shinhanlife/axhub/biz/mcp/adapter/sender/HttpEimsSender.java +++ b/axhub-tool-core/src/main/java/io/shinhanlife/axhub/biz/mcp/adapter/sender/HttpEimsSender.java @@ -10,7 +10,6 @@ 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; @@ -26,10 +25,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(); - SimpleClientHttpRequestFactory factory = new SimpleClientHttpRequestFactory(); - factory.setConnectTimeout(glowProps.getMci().getConnectionTimeout() * 1000); - factory.setReadTimeout(glowProps.getMci().getReadTimeout() * 1000); - this.restClient = RestClient.builder().requestFactory(factory).build(); + this.restClient = RestClient.builder().build(); } @Override diff --git a/docker-compose.yml b/docker-compose.yml index 9fda885..71c73a9 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -40,10 +40,12 @@ services: - SPRING_DATA_REDIS_PORT=6379 - AXHUB_GATEWAY_URL=http://gateway:8081 - AXHUB_TOOL_URL=http://tool-sms:8082 - - GLOW_COMMUNICATION_MCI_HOST=http://mci-mock - - GLOW_COMMUNICATION_EXTMCI_HOST=http://mci-mock - - GLOW_COMMUNICATION_EAI_HOST=tcp://mci-mock - + - GLOW_COMMUNICATION_MCI_HOST=http://gateway + - GLOW_COMMUNICATION_MCI_PORT=8081 + - GLOW_COMMUNICATION_EXTMCI_HOST=http://gateway + - GLOW_COMMUNICATION_EXTMCI_PORT=8081 + - GLOW_COMMUNICATION_EAI_HOST=tcp://gateway + - GLOW_COMMUNICATION_EAI_PORT=8081 tool-email: build: context: ./axhub-tool-email @@ -58,10 +60,12 @@ services: - SPRING_DATA_REDIS_PORT=6379 - AXHUB_GATEWAY_URL=http://gateway:8081 - AXHUB_TOOL_URL=http://tool-email:8083 - - GLOW_COMMUNICATION_MCI_HOST=http://mci-mock - - GLOW_COMMUNICATION_EXTMCI_HOST=http://mci-mock - - GLOW_COMMUNICATION_EAI_HOST=tcp://mci-mock - + - GLOW_COMMUNICATION_MCI_HOST=http://gateway + - GLOW_COMMUNICATION_MCI_PORT=8081 + - GLOW_COMMUNICATION_EXTMCI_HOST=http://gateway + - GLOW_COMMUNICATION_EXTMCI_PORT=8081 + - GLOW_COMMUNICATION_EAI_HOST=tcp://gateway + - GLOW_COMMUNICATION_EAI_PORT=8081 tool-other: build: context: ./axhub-tool-other @@ -76,14 +80,9 @@ services: - SPRING_DATA_REDIS_PORT=6379 - AXHUB_GATEWAY_URL=http://gateway:8081 - AXHUB_TOOL_URL=http://tool-other:8084 - - GLOW_COMMUNICATION_MCI_HOST=http://mci-mock - - GLOW_COMMUNICATION_EXTMCI_HOST=http://mci-mock - - GLOW_COMMUNICATION_EAI_HOST=tcp://mci-mock - - mci-mock: - image: wiremock/wiremock:latest - ports: - - "8080:8080" - volumes: - - ./mci-mock/mappings:/home/wiremock/mappings - command: ["--port", "8080", "--verbose"] + - GLOW_COMMUNICATION_MCI_HOST=http://gateway + - GLOW_COMMUNICATION_MCI_PORT=8081 + - GLOW_COMMUNICATION_EXTMCI_HOST=http://gateway + - GLOW_COMMUNICATION_EXTMCI_PORT=8081 + - GLOW_COMMUNICATION_EAI_HOST=tcp://gateway + - GLOW_COMMUNICATION_EAI_PORT=8081