feat: Add WireMock server for MCI testing and fix HttpEimsSender HTTP/2 compatibility issue
This commit is contained in:
@@ -22,7 +22,10 @@ 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();
|
||||
this.restClient = RestClient.builder().build(); // 필요시 타임아웃 팩토리 추가
|
||||
org.springframework.http.client.SimpleClientHttpRequestFactory factory = new org.springframework.http.client.SimpleClientHttpRequestFactory();
|
||||
factory.setConnectTimeout(glowProps.getMci().getConnectionTimeout() * 1000);
|
||||
factory.setReadTimeout(glowProps.getMci().getReadTimeout() * 1000);
|
||||
this.restClient = RestClient.builder().requestFactory(factory).build();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -30,7 +30,7 @@ glow:
|
||||
connection-timeout: 5 # 연결 타임아웃 시간 (초 단위)
|
||||
read-timeout: 5 # 읽기 타임아웃 시간 (초 단위)
|
||||
mci: # 대내MCI 통신 설정
|
||||
host: http://localhost # 대내MCI 호스트 주소
|
||||
host: http://host.docker.internal # 대내MCI 호스트 주소
|
||||
port: 8080 # 대내MCI 포트 번호
|
||||
uri: /mciSend # 대내MCI URI 정보
|
||||
receive-uri: /app/mciReceive # 대내MCI 수신 URI
|
||||
@@ -38,7 +38,7 @@ glow:
|
||||
read-timeout: 30 # 읽기 타임아웃 시간 (초 단위)
|
||||
encoding: UTF-8 # 대내MCI 인코딩 정보
|
||||
extmci: # 대외MCI 통신 설정
|
||||
host: http://localhost # 대외MCI 호스트 주소
|
||||
host: http://host.docker.internal # 대외MCI 호스트 주소
|
||||
port: 8080 # 대외MCI 포트 번호
|
||||
uri: /extmci # 대외MCI URI 정보
|
||||
json-uri: /extmciJson # 대외MCI JSON방식 URI 정보
|
||||
@@ -47,7 +47,7 @@ glow:
|
||||
read-timeout: 30 # 읽기 타임아웃 시간 (초 단위)
|
||||
encoding: EUC-KR # 대외MCI 인코딩 정보
|
||||
eai: # EAI 통신 설정
|
||||
host: tcp://localhost # EAI 호스트 주소 (TODO: 실제 주소로 변경)
|
||||
host: tcp://host.docker.internal # EAI 호스트 주소 (TODO: 실제 주소로 변경)
|
||||
port: 9999 # EAI 포트 번호
|
||||
websocket:
|
||||
endpoint: "/ws-glow"
|
||||
|
||||
@@ -40,6 +40,9 @@ 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
|
||||
|
||||
tool-email:
|
||||
build:
|
||||
@@ -55,6 +58,9 @@ 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
|
||||
|
||||
tool-other:
|
||||
build:
|
||||
@@ -70,3 +76,14 @@ 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"]
|
||||
|
||||
21
mci-mock/mappings/extmci.json
Normal file
21
mci-mock/mappings/extmci.json
Normal file
@@ -0,0 +1,21 @@
|
||||
{
|
||||
"request": {
|
||||
"method": "POST",
|
||||
"urlPath": "/extmci"
|
||||
},
|
||||
"response": {
|
||||
"status": 200,
|
||||
"headers": {
|
||||
"Content-Type": "application/json;charset=UTF-8"
|
||||
},
|
||||
"jsonBody": {
|
||||
"resCode": "0000",
|
||||
"resMsg": "정상 처리되었습니다.",
|
||||
"data": {
|
||||
"status": "SUCCESS",
|
||||
"mock": true,
|
||||
"detail": "가짜 응답 서버(extmci)에서 내려주는 샘플 데이터입니다."
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
21
mci-mock/mappings/mci-send.json
Normal file
21
mci-mock/mappings/mci-send.json
Normal file
@@ -0,0 +1,21 @@
|
||||
{
|
||||
"request": {
|
||||
"method": "POST",
|
||||
"urlPath": "/mciSend"
|
||||
},
|
||||
"response": {
|
||||
"status": 200,
|
||||
"headers": {
|
||||
"Content-Type": "application/json;charset=UTF-8"
|
||||
},
|
||||
"jsonBody": {
|
||||
"resCode": "0000",
|
||||
"resMsg": "정상 처리되었습니다.",
|
||||
"data": {
|
||||
"status": "SUCCESS",
|
||||
"mock": true,
|
||||
"detail": "가짜 응답 서버에서 내려주는 샘플 데이터입니다."
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user