Spring-boot 2.0.0 M1 - 执行器无法正常工作

VSO*_*SOS 4 spring-boot spring-boot-actuator

我有一个Spring-boot项目,它使用spring-boot执行器来提供应用程序统计信息和指标.

通过在项目中添加"spring-boot-starter-actuator"来提供执行器功能.

此时,安全性被禁用,因此项目不会导入spring-security.

使用spring-boot 1.5.x,所有执行器端点(自动提供,作为/ info,以及我特定的端点)都能正常工作.

更新到Spring-boot 2.0.0 M1后,执行器端点不再暴露.调用/ info端点会返回以下错误:

{"timestamp":1496948526890,"status":404,"error":"Not Found","message":"No 
message available","path":"/info"}
Run Code Online (Sandbox Code Playgroud)

关于Tomcat的注释:我正在重新定义tomcat.version属性,以便使用版本9.

  • 使用spring-boot 1.5.x时,tomcat.version = 9.0.0.M9
  • 使用spring-boot 2.0.0.M1时,tomcat.version = 9.0.0.M21

Dar*_*the 6

它看起来就像端点不再映射到/ info

2017-06-08 13:11:57.817 [main] INFO o.s.b.a.e.mvc.EndpointHandlerMapping - Mapped "{[/application/info || /application/info.json],methods=[GET],produces=[application/vnd.spring-boot.actuator.v2+json || application/json]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.EndpointMvcAdapter.invoke()

并且根据2.0.0/SNAPSHOT文档,这是预期的.

https://docs.spring.io/spring-boot/docs/current-SNAPSHOT/reference/htmlsingle/#production-ready-endpoints

尝试 /application/info


Eri*_*agt 6

它再次移动了.现在,URL生活在/actuator,例如:/actuator/health.

请参阅https://docs.spring.io/spring-boot/docs/current-SNAPSHOT/reference/htmlsingle/#production-ready-endpoints