Reputation: 97
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
Upvotes: 5
Views: 2807
Reputation: 371
According to Spring Docs, in order to show the endpoint user need to have ACTUATOR role.If you need to access without having the role you need to add the following value to application.properties:
management.security.enabled=false
Upvotes: 1
Reputation: 2101
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.
Upvotes: 0
Reputation: 16656
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)
Upvotes: 1