문서의 선택한 두 판 사이의 차이를 보여줍니다.
양쪽 이전 판 이전 판 다음 판 | 이전 판 다음 판 양쪽 다음 판 | ||
springframework:springboot:actuator [2018/03/28 16:32] kwon37xi |
springframework:springboot:actuator [2018/08/21 13:33] kwon37xi [Health Check] |
||
---|---|---|---|
줄 14: | 줄 14: | ||
management.server.port=-1 # http endpoint 끄기 | management.server.port=-1 # http endpoint 끄기 | ||
</ | </ | ||
+ | |||
+ | ===== Health Check ===== | ||
+ | * [[https:// | ||
+ | <code java> | ||
+ | import org.springframework.boot.actuate.health.Health; | ||
+ | import org.springframework.boot.actuate.health.HealthIndicator; | ||
+ | import org.springframework.stereotype.Component; | ||
+ | |||
+ | @Component | ||
+ | public class MyHealthIndicator implements HealthIndicator { | ||
+ | |||
+ | @Override | ||
+ | public Health health() { | ||
+ | int errorCode = check(); // perform some specific health check | ||
+ | if (errorCode != 0) { | ||
+ | return Health.down().withDetail(" | ||
+ | } | ||
+ | return Health.up().build(); | ||
+ | } | ||
+ | |||
+ | } | ||
+ | </ | ||
+ | * [[https:// | ||