Sunday, September 5, 2021

SpringBoot: DevTools basics

Spring Boot DevTools

·         Dependency is spring-boot-devtools

·         Caching is by default disabled in dev environments, as this helps developer to identify the issues due to property/data changes quickly

·         Logging: For web applications, if you want log all incoming requests, which handler is processing it, the response outcome, etc., then turn on spring.mvc.log-request-details

·         Restart: Applications that use devtools will automatically restart once file on classpath changes

·         Restart Technology of Spring Boot is

o   Application files are loaded in restart classloader

o   File that do not change like thirdparty jar files are loaded in base classloader

o   When application is restarted, only restart classloader is re-created, much faster

·         Trigger File: if you do not want restarts on each file change use trigger file spring.devtools.restart.trigger-file. Any update to a file will trigger a check, restart will only occur if devtools has detected change in trigger file

·         Live Reload: Devtools includes embedded LiveReload server, so that if there is change in file browser will refresh automatically. You can disable it by setting spring.devtools.livereload.enabled property to false

·         Profiles: Profiles are not supported in devtools properties/yaml files

·         Remote Support: Devtools remote support is available using spring.devtools.remote.secret property, but considering security risk, should only be used in trusted network or with SSL, should not be used in prod env 

No comments:

SpringBoot: Features: SpringApplication

Below are a few SpringBoot features corresponding to SpringApplication StartUp Logging ·          To add additional logging during startup...