Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
1
© 2016 Pivotal
Spring Boot under the Hood
Nicolas Fränkel, Senior Consultant, SAP hybris
@nicolas_frankel
2
Me, Myself and I
@nicolas_frankel #springboot
 Developer/Software -/Solution Architect
• Java
• As consultant
3
hybris, an SAP company
@nicolas_frankel #springboot
4 @nicolas_frankel #springboot
5 @nicolas_frankel #springboot
6
Spring Boot actuator
@nicolas_frankel #springboot
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>s...
7
/health
@nicolas_frankel #springboot
{
"status" : "UP",
"diskSpace" : {
"status" : "UP",
"total" : 499055067136,
"free" ...
8
Spring boot
 Works well until:
• It doesn’t anymore
• Or you want to change the default behavior
@nicolas_frankel #spri...
9
There’s no magic involved
@nicolas_frankel #springboot
10
Configuration – pom.xml
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-j...
11
Starters dependencies
@nicolas_frankel #springboot
12
spring-boot-autoconfigure.jar
@nicolas_frankel #springboot
13
spring.factories
@nicolas_frankel #springboot
14
@JPARepositoriesAutoConfiguration
@Configuration
@ConditionalOnBean(DataSource.class)
@ConditionalOnClass(JpaRepository...
15
@Conditional
 @ConditionalOnBean
 @ConditionalOnClass
 @ConditionalOnMissingBean
 @ConditionalOnProperty
 etc.
@ni...
16
Remember @Profile?
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE)
public @interface Profile {
String[] v...
17
This is the new @profile
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.TYPE, ElementType.METHOD})
@Documente...
18
@conditional & condition
@nicolas_frankel #springboot
19
@conditional & condition
 Enables calling of a @Bean-annotated method
• In the context of a @Configuration class
@nico...
20
Demo
Let’s play with
conditionals
@nicolas_frankel #springboot
21
Out-of-the-box conditions
@nicolas_frankel #springboot
Condition Description
OnBeanCondition Checks if a bean is in the...
22
Out-of-the-box conditions
@nicolas_frankel #springboot
Condition Description
AllNestedConditions AND condition
AnyNeste...
23
Demo
Our own starter
@nicolas_frankel #springboot
24
Q&A
@nicolas_frankel #springboot
http://blog.frankel.ch/
@nicolas_frankel
http://frankel.in/
https://git.io/v2f3O
25
Chicago: May 30, 31
New York: June 20-21
Atlanta: July 18-19
26
1. Core Spring
2. Spring Professional
Certification
3. Enterprise Spring
4. Enterprise Integration
Specialist Certifica...
27
Learn More. Stay Connected.
Twitter: twitter.com/springcentral
YouTube: spring.io/video
LinkedIn: spring.io/linkedin
Pi...
Upcoming SlideShare
Loading in …5
×

Spring Boot under the Hood with Nicholas Frankel

946 views

Published on

This talk will focus on one of the most precious parts of Domain Driven Design, the concept of Strategic Design, as well as Bounded Context, the Context Map and the patterns that are being documented in the Context Map.

An explanation of these principles as well as practical usage scenarios such as migrating a monolithic landscape to microservices is planned for discussion. And, using a hands-on approach, we will demonstrate the concepts surrounding Strategic Design with an application landscape of various Spring Boot Applications.

We thank you in advance for joining us.

Published in: Technology
  • DOWNLOAD FULL BOOKS, INTO AVAILABLE FORMAT ......................................................................................................................... ......................................................................................................................... 1.DOWNLOAD FULL. PDF EBOOK here { https://tinyurl.com/yxufevpm } ......................................................................................................................... 1.DOWNLOAD FULL. EPUB Ebook here { https://tinyurl.com/yxufevpm } ......................................................................................................................... 1.DOWNLOAD FULL. doc Ebook here { https://tinyurl.com/yxufevpm } ......................................................................................................................... 1.DOWNLOAD FULL. PDF EBOOK here { https://tinyurl.com/yxufevpm } ......................................................................................................................... 1.DOWNLOAD FULL. EPUB Ebook here { https://tinyurl.com/yxufevpm } ......................................................................................................................... 1.DOWNLOAD FULL. doc Ebook here { https://tinyurl.com/yxufevpm } ......................................................................................................................... ......................................................................................................................... ......................................................................................................................... .............. Browse by Genre Available eBooks ......................................................................................................................... Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult,
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here

Spring Boot under the Hood with Nicholas Frankel

  1. 1. 1 © 2016 Pivotal Spring Boot under the Hood Nicolas Fränkel, Senior Consultant, SAP hybris @nicolas_frankel
  2. 2. 2 Me, Myself and I @nicolas_frankel #springboot  Developer/Software -/Solution Architect • Java • As consultant
  3. 3. 3 hybris, an SAP company @nicolas_frankel #springboot
  4. 4. 4 @nicolas_frankel #springboot
  5. 5. 5 @nicolas_frankel #springboot
  6. 6. 6 Spring Boot actuator @nicolas_frankel #springboot <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-actuator</artifactId> </dependency>
  7. 7. 7 /health @nicolas_frankel #springboot { "status" : "UP", "diskSpace" : { "status" : "UP", "total" : 499055067136, "free" : 254812135424, "threshold" : 10485760 }, "db" : { "status" : "UP", "database" : "HSQL Database Engine", "hello" : 1 } }
  8. 8. 8 Spring boot  Works well until: • It doesn’t anymore • Or you want to change the default behavior @nicolas_frankel #springboot
  9. 9. 9 There’s no magic involved @nicolas_frankel #springboot
  10. 10. 10 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
  11. 11. 11 Starters dependencies @nicolas_frankel #springboot
  12. 12. 12 spring-boot-autoconfigure.jar @nicolas_frankel #springboot
  13. 13. 13 spring.factories @nicolas_frankel #springboot
  14. 14. 14 @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
  15. 15. 15 @Conditional  @ConditionalOnBean  @ConditionalOnClass  @ConditionalOnMissingBean  @ConditionalOnProperty  etc. @nicolas_frankel #springboot
  16. 16. 16 Remember @Profile? @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.TYPE) public @interface Profile { String[] value(); } @nicolas_frankel #springboot
  17. 17. 17 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
  18. 18. 18 @conditional & condition @nicolas_frankel #springboot
  19. 19. 19 @conditional & condition  Enables calling of a @Bean-annotated method • In the context of a @Configuration class @nicolas_frankel #springboot
  20. 20. 20 Demo Let’s play with conditionals @nicolas_frankel #springboot
  21. 21. 21 Out-of-the-box conditions @nicolas_frankel #springboot 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
  22. 22. 22 Out-of-the-box conditions @nicolas_frankel #springboot Condition Description AllNestedConditions AND condition AnyNestedConditions OR condition NoneNestedCondition NOT condition
  23. 23. 23 Demo Our own starter @nicolas_frankel #springboot
  24. 24. 24 Q&A @nicolas_frankel #springboot http://blog.frankel.ch/ @nicolas_frankel http://frankel.in/ https://git.io/v2f3O
  25. 25. 25 Chicago: May 30, 31 New York: June 20-21 Atlanta: July 18-19
  26. 26. 26 1. Core Spring 2. Spring Professional Certification 3. Enterprise Spring 4. Enterprise Integration Specialist Certification Prerequisites ILT | 2 days Learn how to use Spring Cloud Data Flow to manage data processing use cases Spring Cloud Data Flow Developer ILT & LOL | 2 days Learn how to develop Spring cloud native applications using Spring Cloud Services Spring Cloud Services Spring Training and Certification 1. Core Spring 2. Spring Professional Certification Prerequisites ILT, LOL & ELT | 2 days Learn how to create applications using Spring Boot Spring Boot Developer ILT, LOL & ELT | 2 days Learn how to create applications using Spring Boot Spring Boot Developer Legend: ILT= Instructor Led Training LOL= Live Online ELT= eLearning
  27. 27. 27 Learn More. Stay Connected. Twitter: twitter.com/springcentral YouTube: spring.io/video LinkedIn: spring.io/linkedin Pivotal.io: https://content.pivotal.io/spring-by-pivotal

×