Spring Boot non-WEB projects use actuator

I would like to ask how to use actuator, in non-WEB projects, such as some message consumption services, background job services. There is no need to have WEB function, how to use actuator in this case, can it be connected to Spring Boot Admin?

Jul.08,2021

The

method is the same as the method with web.

first, add dependencies on actuator and spring boot admin in pom.xml :

        <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>
        <dependency>
            <groupId>de.codecentric</groupId>
            <artifactId>spring-boot-admin-starter-client</artifactId>
        </dependency>

then, add the address of spring boot admin to the application.yml file:

spring:
  boot:
    admin:
      client:
        url: "http://localhost:8080"

management:
  endpoints:
    web:
      exposure:
        include: "*"
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1eb26bd-4819a.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1eb26bd-4819a.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?