Cookies help us display personalized product recommendations and ensure you have great shopping experience.

By using this site, you agree to the Privacy Policy and Terms of Use.
Accept
SmartData CollectiveSmartData Collective
  • Analytics
    AnalyticsShow More
    unusual trading activity
    Signal Or Noise? A Decision Tree For Evaluating Unusual Trading Activity
    3 Min Read
    software developer using ai
    How Data Analytics Helps Developers Deliver Better Tech Services
    8 Min Read
    ai for stock trading
    Can Data Analytics Help Investors Outperform Warren Buffett
    9 Min Read
    media monitoring
    Signals In The Noise: Using Media Monitoring To Manage Negative Publicity
    5 Min Read
    data analytics
    How Data Analytics Can Help You Construct A Financial Weather Map
    4 Min Read
  • Big Data
  • BI
  • Exclusive
  • IT
  • Marketing
  • Software
Search
© 2008-25 SmartData Collective. All Rights Reserved.
Reading: Administration of Spring Boot Applications
Share
Notification
Font ResizerAa
SmartData CollectiveSmartData Collective
Font ResizerAa
Search
  • About
  • Help
  • Privacy
Follow US
© 2008-23 SmartData Collective. All Rights Reserved.
SmartData Collective > Software > Administration of Spring Boot Applications
Software

Administration of Spring Boot Applications

Johnnymorgan
Johnnymorgan
6 Min Read
Spring Boot Applications
SHARE

Technology:  Spring Boot Admin is the application for managing and monitoring based on Spring Boot Applications. The application can be registered with Admin Application using HTTP or it can discovered with Spring Cloud. Spring Boot Admin is developed using Spring Actuator Endpoints and user interface is implemented using AngularJS.

SetUp Spring Boot Admin Server:

Add the below dependencies to existing boot application to convert spring boot admin application.

For Maven build tool:

More Read

Big Data Trees with Hadoop HDFS
Preserving Big Data to Live Forever
Is the end of traditional enterprise software near?
For full ERP benefits, use cloud infrastructure and cloud applications.
Best Practice Linux Guide: Your Cloud Strategy
 <Dependency>  
   <groupId>de.codecentric</groupId>  
   <artifactId>spring-boot-admin-server</artifactId>  
   <version>1.5.0</version>  
 </dependency>  
 <dependency>  
   <groupId>de.codecentric</groupId>  
   <artifactId>spring-boot-admin-server-ui</artifactId>  
   <version>1.5.0</version>  
 </dependency>

spring-boot-admin-server provides additional endpoints on top of Spring boot Actuator.

spring-boot-admin-server-ui provides the user interface using angularJS.

Add @EnableAdminServer annotation along with @Configurable annotation on class level annotation.

Registering Client Applications:

For registering application in Spring Boot Admin either include Spring Boot Admin Client Dependency or use Spring Cloud Discovery.

For adding Spring Boot Admin Client dependency need to add below dependency in pom.xml file.

 <dependency>  
   <groupId>de.codecentric</groupId>  
   <artifactId>spring-boot-admin-starter-client</artifactId>  
   <version>1.5.0</version>  
 </dependency>  

And need to specify the URL of the Spring Boot Admin in either property source.

spring.boot.admin.url is the URL of the Spring Boot Admin.

Display client application version number in Spring Boot Admin:

By default Spring Boot Admin depends on META-INF/ build-info.properties to display version in application dashboard.

We can generate this file using spring-boot-maven-plugin, build-info goal.

 <plugin>  
      <groupId>org.springframework.boot</groupId>  
      <artifactId>spring-boot-maven-plugin</artifactId>  
      <executions>  
           <execution>  
                <goals>  
                     <goal>build-info</goal>  
                </goals>  
           </execution>  
      </executions>  
 </plugin>  

JMX Bean Management: Spring Boot Admin Client is depends on Jolokia to interact with JMX beans in Server, by default spring-boot-admin-starter-client will add Jolokia Dependency if not need to add Jolokia dependency in pom.xml file.

Log Level Management: For application using Spring Boot 1.5 later version log levels can be managed out of box, otherwise it will depends on logback, itself depends on Jolokia, so we need to make sure that Jolokia dependency must be present in classpath, include JMXConfigurator.

 <?xml version="1.0" encoding="UTF-8"?>  
 <configuration>  
  <include resource="org/springframework/boot/logging/logback/base.xml"/>  
  <jmxConfigurator/>  
 </configuration>  

Notifications :

RemindingNotifier send the notification of client online/offline availability, and itself delegate notifications another filter.

By default reminder will trigger if the register client application changes to DOWN or OFFLINE.

private String[] reminderStatuses = { “DOWN”, “OFFLINE” }; // constants from RemindingNotifier.class, we can add more statuses if needed by extending the RemindingNotifier and overriding setReminderStatuses() method.

Reminder will start if application status matches with configured statuses, and it will terminate if it doesn`t match.

By default the reminders will sent for every 10 minutes, we can alter using setReminderPeriod(long reminderPeriod) method. By default ReminderNotifier will not start new daemon thread, we need to create spring beans accordingly, so that using spring scheduling notifications will be triggered based on supplied parameters.

 @Configuration  
 public class NotificationConfiguration {  
      @Bean  
      @Primary  
      public RemindingNotifier remindingNotifier() {  
           RemindingNotifier notifier = new RemindingNotifier(filteringNotifier(loggerNotifier()));  
           notifier.setReminderPeriod(TimeUnit.SECONDS.toMillis(10));  
           return notifier;  
      }  
      @Scheduled(fixedRate = 1_000L)  
      public void remind() {  
           remindingNotifier().sendReminders();  
      }  
      @Bean  
      public FilteringNotifier filteringNotifier(Notifier delegate) {  
           return new FilteringNotifier(delegate);  
      }  
      @Bean  
      public LoggingNotifier loggerNotifier() {  
           return new LoggingNotifier();  
      }  
 }  

Mail Notifications:

To enable mail notifications, add below dependency.

 <dependency>  
   <groupId>org.springframework.boot</groupId>  
   <artifactId>spring-boot-starter-mail</artifactId>  
 </dependency>  

We need to provide the mail host details like host, port, username and password using MailProperties class provided by spring boot (using spring.mail prefix)

Ex: Add below properties for spring.mail.host, spring.mail.port spring.mail.username , spring.mail.password and spring.mail.protocol in application.properties.

And below properties are provided by spring boot admin to enable mail notifications.

  1. spring.boot.admin.notify.mail.enabled: enable mail notifications from spring boot admin, and default value is true.
  2. Spring.boot.admin.notify.mail.ignore-changes: Comma-delimited list of status changes to be ignored. Format: “<from-status>:<to-status>”. Wildcards allowed.
  3. spring.boot.admin.notify.mail.to: comma separated mail receipts to whom want to send an email.
  4. spring.boot.admin.notify.mail.cc: comma separated mail receipts to whom want to send carbon copy of an email.
  5. spring.boot.admin.notify.mail.from: from which email address want to send an emails.
  6. spring.boot.admin.notify.mail.subject :mail subject
  7. spring.boot.admin.notify.mail.text : mail body we can form template using spring spEL.

Securing Spring Boot Admin: By default Spring Boot Admin didn`t support the authentication and authorization, but It provides add-on module for supporting security.

Spring-boot-admin-server-ui-login is pluggable application which will support for security, as it is developed on top of spring security we can use spring security configuration to authenticate and authorize.

By extending WebSecurityConfigurerAdapter(provided by Spring Security) we can customize the authentication and authorization process.

After starting admin server and client application we can see the below screens.
spring1

Spring2

spring3

spring4

Conclusion: Spring Boot Admin application is server which is used to monitor Spring Boot applications, and we can get notifications if the client application status changes and we can monitor client JVM state, trace the application request, auditing client request.

TAGGED:Java Development Team
Share This Article
Facebook Pinterest LinkedIn
Share
ByJohnnymorgan
Follow:
Johnny Morgan - A Technical Writer, working with Aegis Software, where he leads team to covers a wide range of topics like. He has been working on technical content for 9+ years, acquiring and developing content in areas such as software, Java, IoT, ASP.NET and Dynamics 365 Services.

Follow us on Facebook

Latest News

0622cae5 f7d7 4f74 84b5 eabd1a823dca
How Data-Driven Grocery Recommendations Help Shoppers Eat Better With Less Effort
Big Data Exclusive
business recovering from data loss
How Data-Driven Businesses Protect MySQL Databases from Shutdown
Big Data Exclusive
ai driven task management
Reducing “Work About Work” with AI Task Managers
Artificial Intelligence Exclusive
data center uptime
Why Rodent-Resistant Conduits Are Critical for Data Center Uptime
Big Data Data Management Exclusive Risk Management

Stay Connected

1.2KFollowersLike
33.7KFollowersFollow
222FollowersPin

SmartData Collective is one of the largest & trusted community covering technical content about Big Data, BI, Cloud, Analytics, Artificial Intelligence, IoT & more.

ai is improving the safety of cars
From Bolts to Bots: How AI Is Fortifying the Automotive Industry
Artificial Intelligence
AI chatbots
AI Chatbots Can Help Retailers Convert Live Broadcast Viewers into Sales!
Chatbots

Quick Link

  • About
  • Contact
  • Privacy
Follow US
© 2008-25 SmartData Collective. All Rights Reserved.
Welcome Back!

Sign in to your account

Username or Email Address
Password

Lost your password?