验证服务是否启动成功可以调用****/ruok接口,端口是服务器实际运行端口返回imok是启动成功,返回no是启动失败 @Order(Ordered.LOWEST_PRECEDENCE) @RestController public class HealthCheckController implements ApplicationListener<ApplicationStartedEvent> { private static boolean IM_OK = false; private static final String SUCCESS_STRING = "imok"; private static final String FAILURE_STRING = "no"; @GetMapping("/ruok") public String ruok() { if (IM_OK) { return SUCCESS_STRING; } return FAILURE_STRING; } @Override public void onApplicationEvent(ApplicationStartedEvent event) { IM_OK = true; } public static boolean imok() { return IM_OK; } }