gpt4 book ai didi

java - Spring Integration + Spring Boot Actuator 端点未显示

转载 作者:搜寻专家 更新时间:2023-11-01 03:35:15 27 4
gpt4 key购买 nike

我一直在尝试了解有关 Spring Boot 的更多信息,我想将 Actuator 端点添加到我的测试 Spring 集成/Spring Boot 项目中。然而,它是一个普通的 CLI Spring 集成项目——当前没有 REST 或 Web 服务。理想情况下,我希望添加在 jar 从命令行运行时使用浏览器查看端点的功能。

我一直在浏览教程,但没有找到很多关于将其添加到常规项目而不是 Web 项目的内容。

我已经添加了依赖项 (spring-boot-actuator),并且可以从 jconsole 看到端点,但是我从来没有看到与我系统上的端口的连接(使用 netstat)并且永远无法导航到那里。

是否有教程或其他东西可以告诉我如何在 CLI 项目中使用 REST 端点?

谢谢

新手

最佳答案

您可以使用 JMX 来监控和管理您的应用程序。查看documentation here .

如果您使用 IntelliJ IDEA,在 application.properties 文件中按 CTRL+Space 可以看到很多为您准备好的 JMX 属性,其中之一是:

endpoints.jmx.enabled=true(true 是默认值)

关于java - Spring Integration + Spring Boot Actuator 端点未显示,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34023477/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com