Spring-boot-admin 2.0

  springboot

Order

This article mainly shows the new features of Spring-Boot-Admin version 2.0

Server instance

maven

        <dependency>
            <groupId>de.codecentric</groupId>
            <artifactId>spring-boot-admin-starter-server</artifactId>
            <version>2.0.0</version>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-webflux</artifactId>
        </dependency>
        <dependency>
            <groupId>org.jolokia</groupId>
            <artifactId>jolokia-core</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-actuator</artifactId>
        </dependency>

Configuration

spring:
  application:
    name: spring-boot-admin-server
eureka:
  instance:
    preferIpAddress: true
    leaseRenewalIntervalInSeconds: 10
  client:
    registryFetchIntervalSeconds: 5
    serviceUrl:
      defaultZone: ${EUREKA_SERVICE_URL:http://localhost:8761}/eureka/

management:
  endpoints:
    web:
      exposure:
        include: "*"
  endpoint:
    health:
      show-details: ALWAYS

config

@Configuration
@EnableAutoConfiguration
@EnableAdminServer
public class AdminServerApplication {

    public static void main(String[] args) {
        SpringApplication.run(AdminServerApplication.class, args);
    }
}

Client instance

maven

        <dependency>
            <groupId>de.codecentric</groupId>
            <artifactId>spring-boot-admin-starter-client</artifactId>
            <version>2.0.0</version>
        </dependency>
                <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-actuator</artifactId>
        </dependency>
        <dependency>
            <groupId>org.jolokia</groupId>
            <artifactId>jolokia-core</artifactId>
        </dependency>

Configuration

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

The address of admin server is configured here.

Running instance

wallboard

图片描述

Wallboard instance details

图片描述

applications

图片描述

journal

图片描述

Summary

The front end of the new version is reconfigured by vue.js, while the back end is reconfigured by using the principle of event sourcing, supporting spring5, removing spring-cloud-starter dependency, and replacing zuul with WebClient. For details, please refer tospring-boot-admin-changes-with-2-x.

For the client side, it is not possible to rely on Spring Cloud Discovery for automatic registration as in version 1.x, and Spring-Boot-Admin-Starter-Client is currently required.

doc