Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
How to get productive with Spring Boot
Search
Madhura Bhave
October 08, 2019
Technology
0
43
How to get productive with Spring Boot
Madhura Bhave
October 08, 2019
Tweet
Share
More Decks by Madhura Bhave
See All by Madhura Bhave
Breaking the Magician's Code
mbhave
0
470
What's new in Spring boot 2.0 - Spring IO
mbhave
4
2.3k
A Sneak Peek into Spring Boot 2.0
mbhave
3
1.4k
Other Decks in Technology
See All in Technology
【Developers Summit 2025】プロダクトエンジニアから学ぶ、 ユーザーにより高い価値を届ける技術
niwatakeru
2
1.4k
(機械学習システムでも) SLO から始める信頼性構築 - ゆる SRE#9 2025/02/21
daigo0927
0
100
データマネジメントのトレードオフに立ち向かう
ikkimiyazaki
6
960
Building Products in the LLM Era
ymatsuwitter
10
5.4k
The Future of SEO: The Impact of AI on Search
badams
0
190
N=1から解き明かすAWS ソリューションアーキテクトの魅力
kiiwami
0
130
飲食店予約台帳を支えるインタラクティブ UI 設計と実装
siropaca
7
1.8k
Goで作って学ぶWebSocket
ryuichi1208
0
190
2025-02-21 ゆるSRE勉強会 Enhancing SRE Using AI
yoshiiryo1
1
330
速くて安いWebサイトを作る
nishiharatsubasa
10
12k
データ資産をシームレスに伝達するためのイベント駆動型アーキテクチャ
kakehashi
PRO
2
530
白金鉱業Meetup Vol.17_あるデータサイエンティストのデータマネジメントとの向き合い方
brainpadpr
6
740
Featured
See All Featured
The Invisible Side of Design
smashingmag
299
50k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
193
16k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
100
18k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
366
25k
Code Reviewing Like a Champion
maltzj
521
39k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
45
9.4k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
4
410
Side Projects
sachag
452
42k
Raft: Consensus for Rubyists
vanstee
137
6.8k
Bash Introduction
62gerente
611
210k
Designing on Purpose - Digital PM Summit 2013
jponch
117
7.1k
Learning to Love Humans: Emotional Interface Design
aarron
273
40k
Transcript
How to get productive with Spring Boot Madhura Bhave
Agenda • Getting Started • Dependency Management / Starters /
start.spring.io • Development-time • Devtools / Auto-configuration report / Configuration Properties / Testing • Production • Actuator endpoints
Getting Started CODE
Parent POM <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>2.1.9.RELEASE</version> </parent>
Parent POM Dependency Management Java Level 1.8 Sensible Plugins Resource
Filtering
Demo Parent POM
Custom Parent POM <dependencyManagement> <dependencies> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-dependencies</artifactId> <version>2.1.9.RELEASE</version> <type>pom</type>
<scope>import</scope> </dependency> </dependencies> </dependencyManagement>
Gradle Dependency management plugins { id 'org.springframework.boot' version ‘2.1.9.RELEASE' }
apply plugin: 'io.spring.dependency-management'
Demo Starters
Starters • One-stop shop for a set of dependencies •
No copy/paste for common use-cases • Starters are managed dependencies • Community starters
start.spring.io Spring Initializr
Development Time Getting productive during development
Demo Back to the code
Devtools • Automatic Restarts • Condition evaluation delta • Sensible
property defaults • Live reload for static resources
Demo Troubleshoot auto-configuration
Troubleshooting auto-Configuration
Troubleshooting auto-Configuration • Condition Evaluation Report with --DEBUG • Conditions
Endpoint • Use the source • *AutoConfiguration • @Conditional*
Demo Configuration properties
Configuration properties • @Value(${“property”}) are tedious • JSR-303 Validation •
Auto-completion • /configprops endpoint • Now also immutable
Demo Testing
Testing ApplicationContext
Testing ApplicationContext
Testing ApplicationContext ApplicationContext
Testing ApplicationContext ApplicationContext
Testing ApplicationContext @WebFluxTest @WebMvcTest @DataMongoTest @DataJpaTest
Testing • Junit 5 • Testcontainers
Testing Spring Boot Applications https://springoneplatform.io/2019/sessions/ testing-spring-boot-applications
Production
• Why is the app down? • Why does the
app work locally but not in production? • What version of the app is running in production?
Actuator Endpoints • Health • Info • Environment • Runtime
configuration of Loggers • JVM Thread dump
Health Endpoint • Aggregates health indicators • Custom health indicators
can be added • Usage: • Authenticated / Unauthenticated • Health Groups
Info Endpoint • Git Information • Branch / Commit ID
/ Commit time • Build Information • Artifact / Group / Version • Custom Info contributorS
Env Endpoint • Access to the Spring Environment • Shows
• Active profiles • property sources in the order of precedence
Loggers Endpoint • access to application’s loggers • Update logger
configuration at runtime
Thread Dump Endpoint • provides a thread dump from the
application’s JVM • Accepts Text/plain requests • compatible with • https://fastthread.io • https://github.com/irockel/tda
Demo Actuator endpoints
Getting productive with Spring Boot Yay @madhurabhave23
[email protected]