在应用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
- Configuration options;