在我的 DropWizard ( v0.7.0 ) 应用程序中,我有DummyHealthCheck
这样的:
public class DummyHealthCheck extends HealthCheck {
@Override
protected Result check() throws Exception {
return Result.healthy();
}
}
然后在我的主要Application
实现中:
public class MyApplication extends Application<MyConfiguration> {
@Override
public void run(MyConfiguration configuration, Environment environment)
throws Exception {
environment.jersey().register(new DummyHealthCheck());
}
}
当我启动服务器时,它成功启动(没有异常/错误),但是我收到以下消息:
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
! THIS APPLICATION HAS NO HEALTHCHECKS. THIS MEANS YOU WILL NEVER KNOW !
! IF IT DIES IN PRODUCTION, WHICH MEANS YOU WILL NEVER KNOW IF YOU'RE !
! LETTING YOUR USERS DOWN. YOU SHOULD ADD A HEALTHCHECK FOR EACH OF YOUR !
! APPLICATION'S DEPENDENCIES WHICH FULLY (BUT LIGHTLY) TESTS IT. !
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
但是当我去时,http://localhost:8081/healthcheck
我看到:
{"deadlocks":{"healthy":true}}
- 这里发生了什么?如何注册我的健康检查?
- 此外,我已将 DropWizard 配置为在端口 8443 上使用 SSL(自签名);我已经验证这适用于我的正常端点。然而,令我惊讶的是,我的管理应用程序仍然通过 HTTP 暴露在 8081 上。我如何也为 HTTPS 配置它?