Quantcast
Channel: spring boot actuator for standalone spring application - Stack Overflow
Viewing all articles
Browse latest Browse all 3

spring boot actuator for standalone spring application

$
0
0

I am trying to learn spring boot actuator. I have a simple basic application which runs via main method. It has not tomcat or anything. It has just one class as below

public class StartUp {    public static void main(String... args) throws InterruptedException {        ConfigurableApplicationContext ctx = SpringApplication.run(StartUp.class,                args);        StartUp mainObj = ctx.getBean(StartUp.class);        mainObj.init();        System.out.println("Application exited");    }    public void init() throws InterruptedException {        System.out.println("inside init method");        Thread.sleep(10 * 60 * 1000);        System.out.println("outside init method");    }}

I have configured spring actuator as below in pom:

<parent><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-parent</artifactId><version>1.3.3.RELEASE</version></parent><dependencies><!-- [3] --><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter</artifactId></dependency><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-actuator</artifactId></dependency><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-security</artifactId></dependency></dependencies><build><plugins><plugin><groupId>org.springframework.boot</groupId><artifactId>spring-boot-maven-plugin</artifactId></plugin></plugins></build>

I was trying to view the applications health and info, i have configured the below in application.properties

management.port=8091management.address=127.0.0.1management.security.enabled=falseendpoints.shutdown.enabled=trueinfo.app.name=Startup Dashboardinfo.app.version=2.0-ALPHAlogging.file=dashboard.log

while trying the url : http://localhost:8091/infoit never gets resolved.

Is it not possible to configure actuator for standalone applications ?


Viewing all articles
Browse latest Browse all 3

Latest Images

Trending Articles





Latest Images