shutdown endpoint 수신까지만 완료

main
icksishu@gmail.com 2 months ago
parent d438b1a951
commit 5de747008e

@ -35,10 +35,10 @@
} }
], ],
"sqlMapperLocations": [ "sqlMapperLocations": [
"D:/projects/bsm-lab/dfx/dfxagent/src/docs/agent-tuf-a15-defree-oracle/conf/mappers/**/*.xml" "D:/projects/bsm-lab/dfx/dfxagent/src/docs/agent-bsm-lab-postgres/conf/mappers/**/*.xml"
], ],
"logging": { "logging": {
"logDirectory": "D:/projects/bsm-lab/dfx/dfxagent/src/docs/agent-tuf-a15-defree-oracle/logs", "logDirectory": "D:/projects/bsm-lab/dfx/dfxagent/src/docs/agent-bsm-lab-postgres/logs",
"logFileName": "dfxagent.log", "logFileName": "dfxagent.log",
"logName": "DFX_LOG", "logName": "DFX_LOG",
"maxHistory": 30, "maxHistory": 30,
@ -59,10 +59,10 @@
] ]
}, },
"dropBoxConfig": { "dropBoxConfig": {
"receivedMessageStorageRoot": "D:/projects/bsm-lab/dfx/dfxagent/src/docs/agent-tuf-a15-defree-oracle/messages/received", "receivedMessageStorageRoot": "D:/projects/bsm-lab/dfx/dfxagent/src/docs/agent-bsm-lab-postgres/messages/received",
"processedMessageStorageRoot": "D:/projects/bsm-lab/dfx/dfxagent/src/docs/agent-tuf-a15-defree-oracle/messages/processed", "processedMessageStorageRoot": "D:/projects/bsm-lab/dfx/dfxagent/src/docs/aagent-bsm-lab-postgres/messages/processed",
"failureMessageStorageRoot": "D:/projects/bsm-lab/dfx/dfxagent/src/docs/agent-tuf-a15-defree-oracle/messages/failure", "failureMessageStorageRoot": "D:/projects/bsm-lab/dfx/dfxagent/src/docs/agent-bsm-lab-postgres/messages/failure",
"manualMessageStorageRoot": "D:/projects/bsm-lab/dfx/dfxagent/src/docs/agent-tuf-a15-defree-oracle/messages/manual", "manualMessageStorageRoot": "D:/projects/bsm-lab/dfx/dfxagent/src/docs/agent-bsm-lab-postgres/messages/manual",
"threadPoolSize": 300, "threadPoolSize": 300,
"retentionDaysOfProcessedMessage": 60, "retentionDaysOfProcessedMessage": 60,
"dropBoxList": [ "dropBoxList": [

@ -9,7 +9,7 @@ import org.springframework.stereotype.Component;
import java.util.Map; import java.util.Map;
@Endpoint(id = "shutdown") @Endpoint(id = "dfxagentShutdown")
@Component @Component
@RequiredArgsConstructor @RequiredArgsConstructor
@Slf4j @Slf4j
@ -20,6 +20,7 @@ public class DfxAgentShutdownEndpoint {
@Builder @Builder
@AllArgsConstructor @AllArgsConstructor
@NoArgsConstructor @NoArgsConstructor
@ToString
public static class DfxAgentShutdownRequestDto { public static class DfxAgentShutdownRequestDto {
private String comment; private String comment;
private int exitCode; private int exitCode;
@ -29,20 +30,23 @@ public class DfxAgentShutdownEndpoint {
/** /**
* # 3 , 15 (), exitCode=0 * # 3 , 15 (), exitCode=0
* curl -X POST http://localhost:8080/actuator/shutdown \ * curl -X POST "http://localhost:63801/actuator/dfxagentShutdown" -H "Content-Type: application/json" -H "User-Agent: DFXConsole" -d "{\"comment\":\"배포하기 위해 종료\",\"exitCode\":0,\"delaySeconds\":3,\"forceAfterSeconds\":15}"
* -H "Content-Type: application/json" \ * @param comment ) "배포하기 위해 종료"
* -d '{ * @param exitCode 0 9
* "comment":"배포하기 위해 종료", * @param delaySeconds ()
* "exitCode":0, * @param forceAfterSeconds ()
* "delaySeconds":3, * @return {@return }
* "forceAfterSeconds":15
* }'
* @param body
* @return
*/ */
@WriteOperation // Actuator 엔드포인트는 @WriteOperation 으로 POST 요청을 수신함. @ReadOperation GET 요청 수신 @WriteOperation // Actuator 엔드포인트는 @WriteOperation 으로 POST 요청을 수신함. @ReadOperation GET 요청 수신
public Map<String, Object> shutdown(DfxAgentShutdownRequestDto body) { public Map<String, Object> shutdown(String comment, int exitCode, int delaySeconds, int forceAfterSeconds) {
Map<String, Object> receivedData = Map.of(
return null; "status", "SHUTDOWN_SCHEDULED",
"comment", comment,
"exitCode", exitCode,
"delaySeconds", delaySeconds,
"forceAfterSeconds", forceAfterSeconds
);
log.debug("{}", receivedData);
return receivedData;
} }
} }

@ -15,7 +15,10 @@ management:
exclude: '*' exclude: '*'
web: web:
exposure: exposure:
include: shutdown include: dfxagentshutdown
endpoint:
dfxagentShutdown:
enabled: true
logging: logging:
level: level:
root: ERROR root: ERROR

Loading…
Cancel
Save