简体   繁体   English

如何在Spring Boot中指定自定义运行状况检查注册表(application.yml)

[英]How to specify custom health check registry in spring boot (application.yml)

Is it possible to inject a custom com.codahale.metrics.health.HealthCheckRegistry in a spring boot application using the property spring.datasource.hikari.health-check-registry in application.yml ? 是否可以使用application.yml中的spring.datasource.hikari.health-check-registry属性在春季启动应用程序中注入自定义com.codahale.metrics.health.HealthCheckRegistry And how to do that? 以及如何做到这一点?

spring:
  datasource:
    driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
    url: jdbc:sqlserver://localhost:1433;databaseName=mydb;failoverPatner=
    username: db_user
    password: db_pass
    hikari:
      data-source-properties:
        cachePrepStmts: true
        prepStmtCacheSize: 250
      health-check-registry: ???????
    jmx-enabled: true

I suggest choosing an alternative because there is little information about this. 我建议选择一种替代方法,因为有关此方面的信息很少。

I searched Google and StackOverflow and found nothing useful. 我搜索了Google和StackOverflow,发现没有任何用处。

Hope this could be useful for you. 希望这对您有用。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在 application.yml Spring Cloud Gateway 中指定自定义过滤器 - How to Specify custom filter in application.yml Spring Cloud Gateway 是否可以在自定义 Spring boot starter 中使用默认 application.yml? - Is it possible to have a default application.yml in a custom Spring boot starter? Java Spring 引导自定义属性在 application.yml 中不起作用 - Java Spring Boot custom properties dont work in application.yml Spring Boot - 如何通过实现 BeforeAllCallback 的自定义扩展类设置或覆盖 application.yml 中定义的属性? - Spring Boot - How to set or override properties defined in application.yml via a custom extension class that implements BeforeAllCallback? 如何将 application.yml 中的 map 注入 Spring 引导中的字段? - How to inject a map from application.yml into a field in Spring Boot? 如何在 spring 引导中的 application.yml 中定义空列表 - How to define empty list in application.yml in spring boot Spring Boot application.yml 和 @Value 不起作用 - Spring Boot application.yml and @Value is not working spring 启动应用程序.yml 中的环境变量 - Environment variable in spring boot application.yml 如何使用 docker run 命令为 Spring Boot 应用程序覆盖 application.yml 中的 spring 属性? - How can you override a spring property in application.yml for a Spring Boot application using the docker run command? Spring boot application.yml 中的 Spring Kafka SSL 设置 - Spring Kafka SSL setup in Spring boot application.yml
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM