문서의 선택한 두 판 사이의 차이를 보여줍니다.
양쪽 이전 판 이전 판 다음 판 | 이전 판 다음 판 양쪽 다음 판 | ||
springframework:springboot:actuator [2018/08/21 13:30] kwon37xi |
springframework:springboot:actuator [2019/03/25 20:19] kwon37xi |
||
---|---|---|---|
줄 17: | 줄 17: | ||
===== Health Check ===== | ===== Health Check ===== | ||
* [[https:// | * [[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:// | * [[https:// | ||
+ | |||
+ | ===== 참조 ===== | ||
+ | * [[https:// | ||
+ | * [[https:// | ||
+ | * [[https:// | ||
+ | * [[https:// | ||
+ | |||