This is the 8th day of my participation in the November Gwen Challenge. Check out the event details: The last Gwen Challenge 2021.

The previous article introduced how to set up the SpringBoot Admin monitoring server, this article will explain how this project is applied.

Create an e-Commerce -admin submodule

Create the corresponding package and file, as shown in the figure. Remember to reload project after modifying the POM file.

In the bootstrap.yml file, the exposed endpoint is configured. Include represents the endpoints that need to be opened; by default, only the health and INFO endpoints are opened. You can open all endpoints by setting an asterisk.

After starting the project, you can go to the 127.0.0.1/ e-Commerce -admin page (as shown in the image above, the configuration path in the bootstrap.yml file) and it will be successful if it appears as shown below.

The three-bar icon in the upper right corner shows a variety of information, including the current process, running time, CPU usage, garbage collection times, number of threads, etc., which can be used to monitor our project and display a visual interface.

The application is registered with the SpringBoot Admin Server

There are two ways for monitored and managed applications (microservices) to register with the Admin Server.

Methods a

Monitored and managed applications are registered with the SpringBoot Admin Server through HTTP calls using the SpringBoot Admin Client library.

Note: This approach is mainly used in pure SpringBoot applications, and is rarely used in microservices architectures, which is cumbersome and unnecessary.

Way 2

First, the monitored and managed applications are registered with the SpringCloud integrated registry (Nacos), through which the SpringBoot Admin Server proactively obtains the monitored and managed applications.

Note: This is the approach adopted in the microservice architecture. This approach is simple and convenient, and we only need to make small changes to access it. Directly register our projects in the SpringCloud integrated registry, and then make some configurations for the projects (expose the Actuator, modify the bootstrap.yml file in the e-commerce- Alibaba – Nacos-client project).

Three, validation,

Start the e-commerce-alibaba-nacos-client micro-service (NacosClientApplication), open our nacos Console page, and you can deliver the existing two services from the service list, indicating that these two services have been successfully started and registered.

When you open the Spring Boot Admin page, you can also find two services in the application wall.

Our SpringBoot Admin monitoring server has been set up, very simple and convenient.

This series of articles on Spring Cloud/Alibaba micro-service architecture thanks to Zhang Qinyi for his guidance!