shutdown endpoint 수신까지만 완료

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

@ -35,10 +35,10 @@
}
],
"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": {
"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",
"logName": "DFX_LOG",
"maxHistory": 30,
@ -59,10 +59,10 @@
]
},
"dropBoxConfig": {
"receivedMessageStorageRoot": "D:/projects/bsm-lab/dfx/dfxagent/src/docs/agent-tuf-a15-defree-oracle/messages/received",
"processedMessageStorageRoot": "D:/projects/bsm-lab/dfx/dfxagent/src/docs/agent-tuf-a15-defree-oracle/messages/processed",
"failureMessageStorageRoot": "D:/projects/bsm-lab/dfx/dfxagent/src/docs/agent-tuf-a15-defree-oracle/messages/failure",
"manualMessageStorageRoot": "D:/projects/bsm-lab/dfx/dfxagent/src/docs/agent-tuf-a15-defree-oracle/messages/manual",
"receivedMessageStorageRoot": "D:/projects/bsm-lab/dfx/dfxagent/src/docs/agent-bsm-lab-postgres/messages/received",
"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-bsm-lab-postgres/messages/failure",
"manualMessageStorageRoot": "D:/projects/bsm-lab/dfx/dfxagent/src/docs/agent-bsm-lab-postgres/messages/manual",
"threadPoolSize": 300,
"retentionDaysOfProcessedMessage": 60,
"dropBoxList": [

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

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

Loading…
Cancel
Save