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
WACATE2024冬セッション資料(ユーザビリティ)
scarletplover
0
190
Postman と API セキュリティ / Postman and API Security
yokawasa
0
200
Wantedly での Datadog 活用事例
bgpat
1
440
Amazon VPC Lattice 最新アップデート紹介 - PrivateLink も似たようなアップデートあったけど違いとは
bigmuramura
0
190
DevOps視点でAWS re:invent2024の新サービス・アプデを振り返ってみた
oshanqq
0
180
成果を出しながら成長する、アウトプット駆動のキャッチアップ術 / Output-driven catch-up techniques to grow while producing results
aiandrox
0
290
大幅アップデートされたRagas v0.2をキャッチアップ
os1ma
2
530
私なりのAIのご紹介 [2024年版]
qt_luigi
1
120
KubeCon NA 2024 Recap: How to Move from Ingress to Gateway API with Minimal Hassle
ysakotch
0
200
Microsoft Azure全冠になってみた ~アレを使い倒した者が試験を制す!?~/Obtained all Microsoft Azure certifications Those who use "that" to the full will win the exam! ?
yuj1osm
2
110
ガバメントクラウドのセキュリティ対策事例について
fujisawaryohei
0
530
Snowflake女子会#3 Snowpipeの良さを5分で語るよ
lana2548
0
230
Featured
See All Featured
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
26
1.9k
BBQ
matthewcrist
85
9.4k
Bootstrapping a Software Product
garrettdimon
PRO
305
110k
Building Applications with DynamoDB
mza
91
6.1k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
127
18k
Fantastic passwords and where to find them - at NoRuKo
philnash
50
2.9k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
356
29k
GraphQLの誤解/rethinking-graphql
sonatard
67
10k
The MySQL Ecosystem @ GitHub 2015
samlambert
250
12k
Build your cross-platform service in a week with App Engine
jlugia
229
18k
No one is an island. Learnings from fostering a developers community.
thoeni
19
3k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
665
120k
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]