Inside Spring Boot

Dave Syer, 2017

Agenda

  • What’s under the hood in Spring Boot?
  • How much do I need to care?

Spring Boot

  • Entry point for standalone apps
  • Embedded servers
  • Build tools and executable jars
  • External configuration (@ConfigurationProperties)
  • Autoconfiguration
  • Actuator
  • Test framework

Spring Boot

Cloud Native Spring applications

Autoconfiguration

 
 
Opinionated magic

Autoconfiguration

 
 
Boilerplate configuration

SpringApplication Lifecycle

Activity Callbacks Events

 

 

ApplicationStartingEvent

Logging initialization start

 

ApplicationEvironmentPreparedEvent

Config files

EnvironmentPostProcessor

 

Logging initialization end

 

ApplicationPreparedEvent

 

ApplicationContextInitializer

 

ApplicationContext refreshes

EmbeddedServletContainerCustomizer

 

Autoconfig processed

 

 

User config processed

SmartLifecycle

ContextRefreshedEvent

Embedded container connectors

 

EmbeddedServletContainerInitializedEvent

 

 

ApplicationReadyEvent

Actuator

  • Endpoints
  • Health indicators
  • Metrics

Spring Cloud Context

  • Bootstrap: adds a tiny parent context in an ApplicationContextInitializer
  • PropertySourceLocator
  • @RefreshScope
  • Decryption of environment properties

/