我有一个小项目,用Greenwich.SR4版本运行Spring Boot和Spring Cloud Streams。
到目前为止,我已经尝试包含以下依赖项。
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-actuator-autoconfigure</artifactId>
</dependency>希望拥有一个基本上返回代码200的/check/health端点。
我已经相应地修改了配置,这样就不会有无用的健康配置了。
management.endpoints.web.base-path=/check
management.endpoint.health.enabled=true
management.health.solr.enabled=false
management.health.elasticsearch.enabled=false但是,每当我尝试运行localhost:8080/check/health时,都会提示A404。可能会发生什么?
我还提到,我曾尝试包含我自己的@RestController,但同样的行为也发生了。
发布于 2019-12-02 23:06:49
运行状况检查的URL应为http://localhost:8080/check/health,而不是/check/status。
发布于 2019-12-03 19:50:40
这取决于Spring-Boot版本。在2.0版本之后,路径名为manage,因此您的右侧url为:http://localhost:8080/check/health
您还可以使用(.yml版本)进行更改:
management:
context-path: /manage
security:
enabled: falsehttps://stackoverflow.com/questions/59141015
复制相似问题