forked from kimhyungsik/ax_hub_mcp_tool
feat: Implement native HTTP/2 Mock Server in Gateway
This commit is contained in:
@@ -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<String, Object> 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<String, Object> extmci() {
|
||||
return Map.of(
|
||||
"resCode", "0000",
|
||||
"resMsg", "정상 처리되었습니다.",
|
||||
"data", Map.of(
|
||||
"status", "SUCCESS",
|
||||
"mock", true,
|
||||
"protocol", "HTTP/2 (h2c)",
|
||||
"detail", "가짜 응답 서버(HTTP/2 WebFlux)에서 내려주는 대외(EXTMCI) 샘플 데이터입니다."
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
spring.application.name=axhub-admin
|
||||
server.port=8081
|
||||
server.http2.enabled=true
|
||||
|
||||
# 기본적으로 local 환경을 실행
|
||||
spring.profiles.active=local
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user