I have been trying to learn more about Spring Boot and I would like to add the Actuator endpoints to my test Spring integration/Spring Boot project. However, it is a plain, CLI Spring integration project--there are no current REST or web services. I'd ideally like to add the ability to view the endpoints with a browser while the jar is running from the command line.
I have been looking through the tutorials and I'm not finding a lot on adding it to a regular project, rather than a web project.
I've added the dependencies (spring-boot-actuator), and can see the endpoints from the jconsole, but I never see a connection to a port on my system (using netstat) and never can navigate there.
Is there a tutorial or something that can show me how to have REST endpoints with a CLI project?
Thank you
newbo
据春文件 ,以显示端点用户需要有执行器 role.If你需要,而不必需要将以下值添加到application.properties角色访问:
management.security.enabled=false
I think if it isn't a web project, no tomcat servlet will be embedded, therefor you wont be able to browse the actuator endpoints over http
Insert dependency spring-boot-starter-web
into your project and it will probably work.
You can monitor and manage your application using JMX
instead. See the documentation here .
If you use IntelliJ IDEA, hit CTRL+Space
in an application.properties
file to see a lot of JMX
properties ready for you, one of them being:
endpoints.jmx.enabled=true
(true is the default value)
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.