cadec-2029-SPRING SPRING BOOT LEARNIGN PURPOSE

CHARANKUMARREDDYBOJJ 13 views 22 slides Jun 25, 2024
Slide 1
Slide 1 of 22
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17
Slide 18
18
Slide 19
19
Slide 20
20
Slide 21
21
Slide 22
22

About This Presentation

Introduction to Spring Boot
Spring Boot is a framework designed to simplify the development of new Spring applications. Built on top of the Spring Framework, Spring Boot offers a streamlined way to create stand-alone, production-ready applications. It achieves this by providing a set of default conf...


Slide Content

| CALLISTAENTERPRISE.SE
SPRING BOOT
MATS EKHAMMAR
2016-01-27

• Simple example
• What is Spring Boot?
• Demo application
• Jar!les
• Developer Tools
• Con!guration from con!g server
• Actuator
• Wrap up
AGENDA
2

• Simple example
- REST service
• Spring Boot CLI (Command Line Interface)
- Groovy !les
INTRODUCING SPRING BOOT

Spring yyy
con!g
props
Spring xxx
con!g
props
SPRING BOOT EMERGING
4
Spring Boot!
props
Spring Security
con!g
props
pom.xml
+
con!g
Spring Data
con!g
props
Spring Web
con!g
props props
pom.xml

• Helps creating Spring Applications
• Convention over con!guration

• Starter POMS
- Automatic con!guration with sensible defaults
- Example: spring-boot-starter-web
• Features
- Monitoring
- Metrics
- …
WHAT IS SPRING BOOT
5

• ”Getting started” the easy way quickly

• Check out new features in the Spring stack
• Minimal immediate knowledge of dependencies, con!guration, …

• Need to create small autonomous applications (microservices)
• Distributed system landscape
WHY – WHEN
6

• Rolling two dices
• REST endpoint
- /roll
• WEB page URL
- /rolling
• Eclipse STS (Spring Tool Suite)
DEMO APPLICATION
7

• demo-0.0.1-SNAPSHOT.jar
- big
• über-jar

• MANIFEST.MF
- Main-Class: org.springframework.boot.loader.JarLauncher
JAR FILES
8

EXECUTABLE JAR
9
• ”Script !le”
• pom.xml

<groupId>org.springframework.boot </groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<executable>true</executable>
</configuration>

@SpringBootApplication
public class DicesServiceApplication {
public static void main(String[] args){
SpringApplication.run (DicesServiceApplication.class , args);
}
}

MAIN APPLICATION CLASS
10

• @Con!guration

• @ComponentScan
• @EnableAutoCon!guration
@SPRINGBOOTAPPLICATION
11

• Parent
- version 1.3.2.RELEASE
• Dependencies
- org.springframework.boot
» spring-boot-starter-web
» spring-boot-starter-thymeleaf
» spring-boot-starter-test
POM.XML
12

• Dependencies
- org.springframework.boot
» spring-boot-starter
» spring-boot-starter-tomcat
» spring-boot-starter-validation
- com.fasterxml.jackson.core
» jackson-databind
- org.springframework
» spring-web
» spring-webmvc
SPRING-BOOT-STARTER-WEB
13

• Dependencies to turn on
- DevTools
- Con!g
- Actuator
TURN ON DEPENDENCIES
14

• Automatic restart
- Code changes require restart of application
• LiveReload
- html, javascript, templates, images, stylesheets, …
DEVELOPER TOOLS
15

• Con!guration server
- Holds con!gurations for di"erent applications
CONFIGURATION FROM EXTERNAL APPLICATION
16
dices-service con!g-server

• REST Endpoints
- /beans
- /autocon!g
- /env
- /mappings
- …
- /health
- /metrics
- ...
ACTUATOR
17

• Count dice rolls outcome
• CounterService
- Increment
- Decrement
- Reset
ACTUATOR – ADD METRICS
18

• Start using Spring Boot today for you Spring Applications!
• Reduce con!guration ”noise” dramatically
• #ink about what you don’t need to write!

• Enter the microservice arena the ”easy” way
WRAP UP
19

• Spring Boot - http://projects.spring.io/spring-boot
• Initializr - http://start.spring.io
• GitHub - https://github.com/spring-projects/spring-boot
- https://github.com/spring-projects/spring-boot/tree/master/spring-boot-starters
• Callista blogs
- http://callistaenterprise.se/blogg/teknik/2014/04/15/a-!rst-look-at-spring-boot/
- http://callistaenterprise.se/blogg/teknik/2015/10/09/spring-boot-app-as-a-
windows-service/
LINKS
20

21
?

•  QUIZ !!
PETERS PRESENTATION
22
Tags