SlideShare a Scribd company logo
SPRING BOOT
UNDER THE
HOOD
@NICOLAS_FRANKEL
ME, MYSELF AND I
@nicolas_frankel #springboot
2
 Developer/Software -
/Solution Architect
• Java
• As consultant
HYBRIS, AN SAP COMPANY
3
@nicolas_frankel #springboot
@nicolas_frankel #springboot
4
@nicolas_frankel #springboot
5
SPRING BOOT ACTUATOR
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-actuator
</artifactId>
</dependency>
@nicolas_frankel #springboot
6
/HEALTH
{
"status" : "UP",
"diskSpace" : {
"status" : "UP",
"total" : 499055067136,
"free" : 254812135424,
"threshold" : 10485760
},
"db" : {
"status" : "UP",
"database" : "HSQL Database Engine",
"hello" : 1
}
}
@nicolas_frankel #springboot
7
SPRING BOOT
Works well until:
• It doesn’t anymore
• Or you want to change the
default behavior
@nicolas_frankel #springboot
8
THERE’S NO MAGIC INVOLVED
@nicolas_frankel #springboot
9
CONFIGURATION – POM.XML
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-data-jpa
</artifactId>
</dependency>
<dependency>
<groupId>org.hsqldb</groupId>
<artifactId>hsqldb</artifactId>
<scope>runtime</scope>
</dependency>
@nicolas_frankel #springboot
10
STARTERS DEPENDENCIES
@nicolas_frankel #springboot
11
SPRING-BOOT-AUTOCONFIGURE.JAR
@nicolas_frankel #springboot
12
SPRING.FACTORIES
@nicolas_frankel #springboot
13
@JPAREPOSITORIESAUTOCONFIGURATION
@Configuration
@ConditionalOnBean(DataSource.class)
@ConditionalOnClass(JpaRepository.class)
@ConditionalOnMissingBean({
JpaRepositoryFactoryBean.class,
JpaRepositoryConfigExtension.class })
@ConditionalOnProperty(
prefix = "spring.data.jpa.repositories",
name = "enabled", havingValue = "true",
matchIfMissing = true)
@Import(JpaRepositoriesAutoConfigureRegistrar.class)
@AutoConfigureAfter(
HibernateJpaAutoConfiguration.class)
public class JpaRepositoriesAutoConfiguration {
}
@nicolas_frankel #springboot
14
@CONDITIONAL
@ConditionalOnBean
@ConditionalOnClass
@ConditionalOnMissingBean
@ConditionalOnProperty
etc.
@nicolas_frankel #springboot
15
REMEMBER @PROFILE?
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE)
public @interface Profile {
String[] value();
}
@nicolas_frankel #springboot
16
THIS IS THE NEW @PROFILE
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.TYPE,
ElementType.METHOD})
@Documented
@Conditional(ProfileCondition.class)
public @interface Profile {
String[] value();
}
@nicolas_frankel #springboot
17
@CONDITIONAL & CONDITION
@nicolas_frankel #springboot
18
@CONDITIONAL & CONDITION
Enables calling of a @Bean-
annotated method
• In the context of a
@Configuration class
@nicolas_frankel #springboot
19
ENOUGH TALK…
@nicolas_frankel #springboot
20
OUT-OF-THE-BOX CONDITIONS
Condition Description
OnBeanCondition Checks if a bean is in the Spring factory
OnClassCondition Checks if a class is on the classpath
OnExpressionCondition Evalutates a SPeL expression
OnJavaCondition Checks the version of Java
OnJndiCondition Checks if a JNDI branch exists
OnPropertyCondition Checks if a property exists
OnResourceCondition Checks if a resource exists
OnWebApplicationCondition Checks if a WebApplicationContext exists
@nicolas_frankel #springboot
21
COMPOSITE CONDITIONS
Condition Description
AllNestedConditions AND condition
AnyNestedConditions OR condition
NoneNestedCondition NOT condition
@nicolas_frankel #springboot
22
OUR OWN STARTER
@nicolas_frankel #springboot
23
Q&A
@nicolas_frankel #springboot
24
http://blog.frankel.ch/
@nicolas_frankel
http://frankel.in/
https://git.io/v2f3O

More Related Content

PPTX
Java Day Lviv - Spring Boot under the hood
PDF
Dont Break Live lightning talk
PDF
Automate everything with PowerShell
PDF
Orgchart for Alfresco lightning talk
PDF
Real Talk About Website Performance : 5 Must-Haves
PDF
Automating everything with Microsoft Flow
PDF
DevOpsDays Baltimore March 2017 - Continuous Integration: A bittersweet love ...
Java Day Lviv - Spring Boot under the hood
Dont Break Live lightning talk
Automate everything with PowerShell
Orgchart for Alfresco lightning talk
Real Talk About Website Performance : 5 Must-Haves
Automating everything with Microsoft Flow
DevOpsDays Baltimore March 2017 - Continuous Integration: A bittersweet love ...

Viewers also liked (15)

PDF
Lost art of troubleshooting
PDF
Asynchronous API in Java8, how to use CompletableFuture
PPTX
Spring boot
PDF
What is tackled in the Java EE Security API (Java EE 8)
PPTX
DevExperience - The Dark Side of Microservices
PPTX
Data Science for Retail Broking
PDF
First appeal under RTI Act 2005 against Registrar (J-I) Supreme Court of Indi...
PPTX
NET-A-PORTER AMP Hackathon
PDF
Transformation structurelle et émergence au Sénégal - Madaniou DIEME
PPT
Environmental policy
PDF
Microservice With Spring Boot and Spring Cloud
PDF
[Aurora事例祭り]AWS Database Migration Service と Schema Conversion Tool の使いドコロ
PDF
Upfront LP Survey of the Venture Capital & Startup Industry
PDF
Spring Boot
PDF
Microservices - java ee vs spring boot and spring cloud
Lost art of troubleshooting
Asynchronous API in Java8, how to use CompletableFuture
Spring boot
What is tackled in the Java EE Security API (Java EE 8)
DevExperience - The Dark Side of Microservices
Data Science for Retail Broking
First appeal under RTI Act 2005 against Registrar (J-I) Supreme Court of Indi...
NET-A-PORTER AMP Hackathon
Transformation structurelle et émergence au Sénégal - Madaniou DIEME
Environmental policy
Microservice With Spring Boot and Spring Cloud
[Aurora事例祭り]AWS Database Migration Service と Schema Conversion Tool の使いドコロ
Upfront LP Survey of the Venture Capital & Startup Industry
Spring Boot
Microservices - java ee vs spring boot and spring cloud
Ad

Similar to jDays - Spring Boot under the Hood (20)

PPTX
Javantura v3 - Spring Boot under the hood– Nicolas Fränkel
PPTX
Javentura - Spring Boot under the hood
PPTX
How to customize Spring Boot?
PPTX
Spring boot
PPTX
Introduction to Spring Boot
PPTX
Spring boot for buidling microservices
PDF
Spring Boot Whirlwind Tour
PPTX
cadec-2016-spring-boot-for-understanding-the-core-concepts.pptx
PDF
Spring Boot
ODP
Xke spring boot
PPT
Spring Boot in Action
PDF
Spring Boot Interview Questions PDF By ScholarHat
PPTX
Spring boot Introduction
PPTX
Bootify your spring application
PPTX
DevTalks Romania Cluj - Spring Boot for DevOps (rebooted for 2.0)
PPTX
Spring boot Under Da Hood
PPTX
Module 6 _ Spring Boot for java application to begin
PDF
Rediscovering Spring with Spring Boot(1)
PDF
dokumen.tips_rediscovering-spring-with-spring-boot1 (1).pdf
PDF
dokumen.tips_rediscovering-spring-with-spring-boot1.pdf
Javantura v3 - Spring Boot under the hood– Nicolas Fränkel
Javentura - Spring Boot under the hood
How to customize Spring Boot?
Spring boot
Introduction to Spring Boot
Spring boot for buidling microservices
Spring Boot Whirlwind Tour
cadec-2016-spring-boot-for-understanding-the-core-concepts.pptx
Spring Boot
Xke spring boot
Spring Boot in Action
Spring Boot Interview Questions PDF By ScholarHat
Spring boot Introduction
Bootify your spring application
DevTalks Romania Cluj - Spring Boot for DevOps (rebooted for 2.0)
Spring boot Under Da Hood
Module 6 _ Spring Boot for java application to begin
Rediscovering Spring with Spring Boot(1)
dokumen.tips_rediscovering-spring-with-spring-boot1 (1).pdf
dokumen.tips_rediscovering-spring-with-spring-boot1.pdf
Ad

More from Nicolas Fränkel (20)

PPTX
SnowCamp - Adding search to a legacy application
PPTX
Un CV de dévelopeur toujours a jour
PPTX
Zero-downtime deployment on Kubernetes with Hazelcast
PDF
jLove - A Change-Data-Capture use-case: designing an evergreen cache
PPTX
BigData conference - Introduction to stream processing
PPTX
ADDO - Your own Kubernetes controller, not only in Go
PPTX
TestCon Europe - Mutation Testing to the Rescue of Your Tests
PPTX
OSCONF Jaipur - A Hitchhiker's Tour to Containerizing a Java application
PPTX
GeekcampSG 2020 - A Change-Data-Capture use-case: designing an evergreen cache
PPTX
JavaDay Istanbul - 3 improvements in your microservices architecture
PPTX
OSCONF Hyderabad - Shorten all URLs!
PPTX
Devclub.lv - Introduction to stream processing
PPTX
OSCONF Koshi - Zero downtime deployment with Kubernetes, Flyway and Spring Boot
PPTX
JOnConf - A CDC use-case: designing an Evergreen Cache
PPTX
London In-Memory Computing Meetup - A Change-Data-Capture use-case: designing...
PPTX
JUG Tirana - Introduction to data streaming
PPTX
Java.IL - Your own Kubernetes controller, not only in Go!
PPTX
vJUG - Introduction to data streaming
PPTX
London Java Community - An Experiment in Continuous Deployment of JVM applica...
PPTX
OSCONF - Your own Kubernetes controller: not only in Go
SnowCamp - Adding search to a legacy application
Un CV de dévelopeur toujours a jour
Zero-downtime deployment on Kubernetes with Hazelcast
jLove - A Change-Data-Capture use-case: designing an evergreen cache
BigData conference - Introduction to stream processing
ADDO - Your own Kubernetes controller, not only in Go
TestCon Europe - Mutation Testing to the Rescue of Your Tests
OSCONF Jaipur - A Hitchhiker's Tour to Containerizing a Java application
GeekcampSG 2020 - A Change-Data-Capture use-case: designing an evergreen cache
JavaDay Istanbul - 3 improvements in your microservices architecture
OSCONF Hyderabad - Shorten all URLs!
Devclub.lv - Introduction to stream processing
OSCONF Koshi - Zero downtime deployment with Kubernetes, Flyway and Spring Boot
JOnConf - A CDC use-case: designing an Evergreen Cache
London In-Memory Computing Meetup - A Change-Data-Capture use-case: designing...
JUG Tirana - Introduction to data streaming
Java.IL - Your own Kubernetes controller, not only in Go!
vJUG - Introduction to data streaming
London Java Community - An Experiment in Continuous Deployment of JVM applica...
OSCONF - Your own Kubernetes controller: not only in Go

Recently uploaded (20)

PDF
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf
PDF
Nekopoi APK 2025 free lastest update
PDF
System and Network Administration Chapter 2
PPT
Introduction Database Management System for Course Database
PDF
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
PDF
Upgrade and Innovation Strategies for SAP ERP Customers
PPTX
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 41
PDF
Adobe Illustrator 28.6 Crack My Vision of Vector Design
PPTX
Operating system designcfffgfgggggggvggggggggg
PDF
Odoo Companies in India – Driving Business Transformation.pdf
PDF
Understanding Forklifts - TECH EHS Solution
PDF
How Creative Agencies Leverage Project Management Software.pdf
PDF
System and Network Administraation Chapter 3
PDF
Softaken Excel to vCard Converter Software.pdf
PDF
2025 Textile ERP Trends: SAP, Odoo & Oracle
PDF
Audit Checklist Design Aligning with ISO, IATF, and Industry Standards — Omne...
PPTX
ai tools demonstartion for schools and inter college
PDF
How to Choose the Right IT Partner for Your Business in Malaysia
PDF
medical staffing services at VALiNTRY
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf
Nekopoi APK 2025 free lastest update
System and Network Administration Chapter 2
Introduction Database Management System for Course Database
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
Upgrade and Innovation Strategies for SAP ERP Customers
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
Internet Downloader Manager (IDM) Crack 6.42 Build 41
Adobe Illustrator 28.6 Crack My Vision of Vector Design
Operating system designcfffgfgggggggvggggggggg
Odoo Companies in India – Driving Business Transformation.pdf
Understanding Forklifts - TECH EHS Solution
How Creative Agencies Leverage Project Management Software.pdf
System and Network Administraation Chapter 3
Softaken Excel to vCard Converter Software.pdf
2025 Textile ERP Trends: SAP, Odoo & Oracle
Audit Checklist Design Aligning with ISO, IATF, and Industry Standards — Omne...
ai tools demonstartion for schools and inter college
How to Choose the Right IT Partner for Your Business in Malaysia
medical staffing services at VALiNTRY

jDays - Spring Boot under the Hood

Editor's Notes

  • #19: skinparam dpi 150 interface Conditional<T extends Condition><<(@,#A9DCDF)>> { value(): Class<T>[] } interface Condition { matches(context:ConditionContext, metadata:AnnotatedTypeMetadata):boolean } abstract class SpringBootCondition class ProfileCondition Conditional .down.> Condition SpringBootCondition .up.|> Condition ProfileCondition .up.|> Condition hide empty members hide empty attributes