欢迎光临
我们一直在努力

Spring Data Neo4j禁用健康检查

在使用Neo4j图谱的过程中,当Neo4j数据库没有启动的使用,默认应用程序就不断的进行健康检查,检测数据库是否能够正常连接,当没有启动Neo4j数据库的使用,应用程序就会报错,提示无法进行连接:

Caused by: org.neo4j.driver.v1.exceptions.ServiceUnavailableException: Unable to connect to localhost:7687, ensure the database is running and that there is a working network connection to it.

但是,我们可以通过SpringBoot配置文件application.yml进行配置,停用不断的健康检查,配置如下:

server:
  port: 9012
spring:
  data:
    neo4j:
      uri: bolt://localhost
      username: neo4j
      password: Passw0rd
management:
    neo4j:
      enabled: false

即,将management.health.neo4j.enabled配置为false

Reference

  1. Configuration options
赞(0) 打赏
未经允许不得转载:Ddmit » Spring Data Neo4j禁用健康检查

评论 抢沙发

觉得文章有用就打赏一下文章作者

非常感谢你的打赏,我们将继续提供更多优质内容,让我们一起创建更加美好的网络世界!

支付宝扫一扫打赏

微信扫一扫打赏

登录

找回密码

注册