执行器如何呈现其端点?

How does the actuator render its endpoints?

大家早上好,

希望这是一个非常简单的问题。

如何支持 spring-boot-actuator 端点?

我可以看到其中大部分的@ReadOperation 和@WriteOperation,但我看不到基础 URL 在哪里受支持或哪些技术支持创建 'http://localhost:8080/actuator' 端点。

当我导航到地址 'http://localhost:8080/actuator' 而不是显示 404 或 500 时,我的项目确实显示了 JSON(我想那是什么?)。

我想了解一下spring-boot-actuator项目的底层架构。 'http://localhost:8080/actuator' URL 处于活动状态,returns 并显示数据。

这个URL好像没有注释:

@ResponseBody
@RequestMapping
@GetMapping
@ReadOperation

千分尺项目似乎不支持'http://localhost:8080/actuator'。

我对执行器编程的工作原理感到很困惑。

感谢大家的帮助。

您所指的根执行器端点 (默认值:/actuator) 确实用 @ResponseBody 注释。你可以在这里查看:https://github.com/spring-projects/spring-boot/blob/0a4c26532dff6f3fa1bf6d2e1c2a74549191117a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/servlet/WebMvcEndpointHandlerMapping.java#L76