By using this site, you agree to the Privacy Policy and Terms of Use.
Accept
SmartData Collective
  • Analytics
    AnalyticsShow More
    data science anayst
    Growing Demand for Data Science & Data Analyst Roles
    6 Min Read
    predictive analytics in dropshipping
    Predictive Analytics Helps New Dropshipping Businesses Thrive
    12 Min Read
    data-driven approach in healthcare
    The Importance of Data-Driven Approaches to Improving Healthcare in Rural Areas
    6 Min Read
    analytics for tax compliance
    Analytics Changes the Calculus of Business Tax Compliance
    8 Min Read
    big data analytics in gaming
    The Role of Big Data Analytics in Gaming
    10 Min Read
  • Big Data
  • BI
  • Exclusive
  • IT
  • Marketing
  • Software
Search
© 2008-23 SmartData Collective. All Rights Reserved.
Reading: Administration of Spring Boot Applications
Share
Notification Show More
Latest News
SMEs Use AI-Driven Financial Software for Greater Efficiency
Artificial Intelligence
data security in big data age
6 Reasons to Boost Data Security Plan in the Age of Big Data
Big Data
data science anayst
Growing Demand for Data Science & Data Analyst Roles
Data Science
ai software development
Key Strategies to Develop AI Software Cost-Effectively
Artificial Intelligence
ai in omnichannel marketing
AI is Driving Huge Changes in Omnichannel Marketing
Artificial Intelligence
Aa
SmartData Collective
Aa
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
Last updated: 2017/05/23 at 1:47 PM
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:

 <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
Johnnymorgan May 24, 2017
Share this Article
Facebook Twitter Pinterest LinkedIn
Share
By Johnnymorgan
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

SMEs Use AI-Driven Financial Software for Greater Efficiency
Artificial Intelligence
data security in big data age
6 Reasons to Boost Data Security Plan in the Age of Big Data
Big Data
data science anayst
Growing Demand for Data Science & Data Analyst Roles
Data Science
ai software development
Key Strategies to Develop AI Software Cost-Effectively
Artificial Intelligence

Stay Connected

1.2k Followers Like
33.7k Followers Follow
222 Followers Pin

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 is improving the safety of cars
From Bolts to Bots: How AI Is Fortifying the Automotive Industry
Artificial Intelligence

Quick Link

  • About
  • Contact
  • Privacy
Follow US

© 2008-23 SmartData Collective. All Rights Reserved.

Removed from reading list

Undo
Go to mobile version
Welcome Back!

Sign in to your account

Lost your password?