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
450
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
マルチプロダクトな開発組織で 「開発生産性」に向き合うために試みたこと / Improving Multi-Product Dev Productivity
sugamasao
1
310
障害対応指揮の意思決定と情報共有における価値観 / Waroom Meetup #2
arthur1
5
480
TanStack Routerに移行するのかい しないのかい、どっちなんだい! / Are you going to migrate to TanStack Router or not? Which one is it?
kaminashi
0
590
[CV勉強会@関東 ECCV2024 読み会] オンラインマッピング x トラッキング MapTracker: Tracking with Strided Memory Fusion for Consistent Vector HD Mapping (Chen+, ECCV24)
abemii
0
220
Amazon CloudWatch Network Monitor のススメ
yuki_ink
1
210
ドメインの本質を掴む / Get the essence of the domain
sinsoku
2
150
rootlessコンテナのすゝめ - 研究室サーバーでもできる安全なコンテナ管理
kitsuya0828
3
390
Platform Engineering for Software Developers and Architects
syntasso
1
520
SREによる隣接領域への越境とその先の信頼性
shonansurvivors
2
520
マルチモーダル / AI Agent / LLMOps 3つの技術トレンドで理解するLLMの今後の展望
hirosatogamo
37
12k
オープンソースAIとは何か? --「オープンソースAIの定義 v1.0」詳細解説
shujisado
9
970
Making your applications cross-environment - OSCG 2024 NA
salaboy
0
190
Featured
See All Featured
The Illustrated Children's Guide to Kubernetes
chrisshort
48
48k
Music & Morning Musume
bryan
46
6.2k
The MySQL Ecosystem @ GitHub 2015
samlambert
250
12k
KATA
mclloyd
29
14k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
226
22k
GitHub's CSS Performance
jonrohan
1030
460k
Git: the NoSQL Database
bkeepers
PRO
427
64k
Raft: Consensus for Rubyists
vanstee
136
6.6k
It's Worth the Effort
3n
183
27k
RailsConf 2023
tenderlove
29
900
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
25
1.8k
Ruby is Unlike a Banana
tanoku
97
11k
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]