Spring Boot – Admin Client

For monitoring and managing your microservice application via Spring Boot Admin Server, you should add the Spring Boot Admin starter client dependency and point out the Admin Server URI into the application properties file.

Note − For monitoring an application, you should enable the Spring Boot Actuator Endpoints for your Microservice application.

First, add the following Spring Boot Admin starter client dependency and Spring Boot starter actuator dependency in your build configuration file.

Maven users can add the following dependencies in your pom.xml file −

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

Gradle users can add the following dependencies in your build.gradle file.

compile group: 'de.codecentric', name: 'spring-boot-admin-starter-client', version: '1.5.5'
compile('org.springframework.boot:spring-boot-starter-actuator')

Now, add the Spring Boot Admin Server URL into your application properties file.

For properties file users, add the following properties in the application.properties file.

spring.boot.admin.url = http://localhost:9090/

For YAML users, add the following property in application.yml file.

spring:
   boot:
      admin:
         url: http://localhost:9000/

Now, create an executable JAR file, and run the Spring Boot application by using the following Maven or Gradle commands.

For Maven, you can use the command as shown −

mvn clean install

After “BUILD SUCCESS”, you can find the JAR file under the target directory.

For Gradle, you can use the command as shown −

gradle clean build

After “BUILD SUCCESSFUL”, you can find the JAR file under the build/libs directory.

Now, run the JAR file by using the command shown −

java –jar <JARFILE> 

Now, the application has started on the Tomcat port 9090 as shown −

Tomcat Port 9090 Output

Now hit the following URL from your web browser and see your spring Boot application is registered with Spring Boot Admin Server.

http://localhost:9090/
Spring Boot Admin Server

Now, click the Details button and the see the actuator endpoints in Admin Server UI.

Actuator Endpoints in Admin Server UI

Related posts:

Java Program to Implement Sieve Of Eratosthenes
Convert Time to Milliseconds in Java
String Joiner trong Java 8
Java Program to Search Number Using Divide and Conquer with the Aid of Fibonacci Numbers
Get and Post Lists of Objects with RestTemplate
Java Program to Use Dynamic Programming to Solve Approximate String Matching
Getting Started with Forms in Spring MVC
Form Validation with AngularJS and Spring MVC
Java Program to Find Strongly Connected Components in Graphs
Spring Boot Actuator
Lớp Collections trong Java (Collections Utility Class)
Java Program to Find the Number of Ways to Write a Number as the Sum of Numbers Smaller than Itself
Java Program to Implement AA Tree
Hướng dẫn Java Design Pattern – Builder
Apache Commons Collections Bag
A Guide to Queries in Spring Data MongoDB
An Introduction to Java.util.Hashtable Class
Java 8 – Powerful Comparison with Lambdas
Java Program to Generate a Graph for a Given Fixed Degree Sequence
Các nguyên lý thiết kế hướng đối tượng – SOLID
Java Program to Implement Hash Tree
Getting Started with Custom Deserialization in Jackson
Java Program to Check the Connectivity of Graph Using BFS
Java Program to Implement Sparse Matrix
Java Program to Implement K Way Merge Algorithm
Java Program to Implement EnumMap API
Lớp Arrarys trong Java (Arrays Utility Class)
Spring Data Reactive Repositories with MongoDB
Java Program to Perform Left Rotation on a Binary Search Tree
Hướng dẫn Java Design Pattern – Abstract Factory
Returning Image/Media Data with Spring MVC
OAuth2 for a Spring REST API – Handle the Refresh Token in AngularJS