java - 数据库运行状况指示器中的 "hello"属性是什么意思? ( Spring 致动器)

标签 java spring spring-boot datasource spring-boot-actuator

我在 Spring 执行器中启用了 DataSourceHealthIndicator,现在在我得到的“健康”端点中:

{
   "status":"UP",
   "details":{
      "db":{
         "status":"UP",
         "details":{
            "database":"H2",
            "hello":1
         }
      },
      "diskSpace":{
         "status":"UP",
         "details":{
            "total":999528853504,
            "free":773661831168,
            "threshold":10485760
         }
      }
   }
}

我想知道数据库信息中的 "hello":1 是什么意思

最佳答案

这意味着数据库健康检查。

假的定期查询(例如 Oracle 中的 select 'hello' from Dual)检查数据库是否仍可从应用程序中使用。在执行器中 "hello":1 表示上次健康检查成功。

参见https://cloud.ibm.com/docs/java?topic=java-spring-healthcheck

关于java - 数据库运行状况指示器中的 "hello"属性是什么意思? ( Spring 致动器),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58219704/

相关文章:

java - org.dbunit.database.AmbigouslyTableNameException

java - 如何处理 Java URL 映射太多而无法手写

java - 在java中以有效的方式从数组中返回重复项

java - Spring Boot - 自定义 JSON 序列化

java - 无法在 STS/Eclipse 中找到或加载主类

java - 连接到 URL

java - Spring 启动 : How to declare a custom repository factory bean

java - 查询参数值不绑定(bind)到 Spring Pageable

java - 使用 PostgreSQL 和 Spring Boot 时是否有规则禁止将其实体类命名为 "User"?

spring-boot - 如何在 Spring Boot 中使用 WebSphere Runtime 库作为独立应用程序