文章目录
使用SpringBoot集成Spring Boot Admin,监测项目的运行状态
基于GitHub项目xkcoding/**spring-boot-demo**进行学习
项目地址:https://github.com/xkcoding/spring-boot-demo
项目结构
- 使用Spring Boot Admin,一般分为服务端以及客户端两个微服务,其中客户端
clinet
到实现项目的具体业务,其会在服务端server
进行注册 - 服务端
server
用来监控所有注册到其本身的客户端服务,并显示它们的相关运行信息
项目父pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>spring-boot-demo</artifactId>
<groupId>com.xkcoding</groupId>
<version>1.0.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>spring-boot-demo-admin</artifactId>
<packaging>pom</packaging>
<properties>
<spring-boot-admin.version>2.1.0</spring-boot-admin.version>
</properties>
<!--注册子模块-->
<modules>
<module>spring-boot-demo-admin-client</module>
<module>spring-boot-demo-admin-server</module>
</modules>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>de.codecentric</groupId>
<artifactId>spring-boot-admin-dependencies</artifactId>
<version>${spring-boot-admin.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>