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
    image fx (67)
    Improving LinkedIn Ad Strategies with Data Analytics
    9 Min Read
    big data and remote work
    Data Helps Speech-Language Pathologists Deliver Better Results
    6 Min Read
    data driven insights
    How Data-Driven Insights Are Addressing Gaps in Patient Communication and Equity
    8 Min Read
    pexels pavel danilyuk 8112119
    Data Analytics Is Revolutionizing Medical Credentialing
    8 Min Read
    data and seo
    Maximize SEO Success with Powerful Data Analytics Insights
    8 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

How to Program MapReduce Jobs in Hadoop with R
Disaster Recovery Solutions in Cloud Infrastructure
Building a Text Analytics Command Center for Social & Private Data Analysis
Why a Mere 300 Exabytes Will Give Us a Headache [VIDEO]
Three Reasons to Check Out Google’s Cloud Solution for Hadoop
 <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

image fx (2)
Monitoring Data Without Turning into Big Brother
Big Data Exclusive
image fx (71)
The Power of AI for Personalization in Email
Artificial Intelligence Exclusive Marketing
image fx (67)
Improving LinkedIn Ad Strategies with Data Analytics
Analytics Big Data Exclusive Software
big data and remote work
Data Helps Speech-Language Pathologists Deliver Better Results
Analytics Big Data Exclusive

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.

data-driven web design
5 Great Tips for Using Data Analytics for Website UX
Big Data
AI and chatbots
Chatbots and SEO: How Can Chatbots Improve Your SEO Ranking?
Artificial Intelligence Chatbots Exclusive

Quick Link

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

Sign in to your account

Username or Email Address
Password

Lost your password?