AGENDA Simple example What is Spring Boot? Demo application Jar fi les Developer Tools Con fi guration from con fi g server Actuator Wrap up 2
INTRODUCING SPRING BOOT Simple example REST service Spring Boot CLI (Command Line Interface) Groovy fi les
ing yyy con fi g props Spring xxx con fi g rops p Spr SPRING BOOT EMERGING 4 Spring Boot! props Spring Security con fi g props pom.xml + con fi g Spring Data con fi g props Spring Web con fi g props props pom.xml
WHAT IS SPRING BOOT Helps creating Spring Applications Convention over con fi guration Starter POMS Automatic con fi guration with sensible defaults Example: spring-boot-starter-web Features Monitoring Metrics - … 5
WHY – WHEN ” Getting started” the easy way quickly Check out new features in the Spring stack Minimal immediate knowledge of dependencies, con fi guration, … Need to create small autonomous applications (microservices) Distributed system landscape <number>
DEMO APPLICATION Rolling two dices REST endpoint /roll WEB page URL /rolling Eclipse STS (Spring Tool Suite) IntelliJ Idea <number>
JAR FILES demo-0.0.1-SNAPSHOT.jar big über-jar MANIFEST.MF Main-Class: org.springframework.boot.loader.JarLauncher <number>
EXECUTABLE JAR ” Script fi le” pom.xml … <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> <configuration> <executable>true</executable> </configuration> … <number>
MAIN APPLICATION CLASS @SpringBootApplication public class DicesServiceApplication { public static void main(String[] args){ SpringApplication.run(DicesServiceApplication.class, args); } } <number>
@SPRINGBOOTAPPLICATION @Con fi guration @ComponentScan @EnableAutoCon fi guration <number>
Con fi guration server - Holds con fi gurations for di ff erent applications CONFIGURATION FROM EXTERNAL APPLICATION dices-service con fi g-server <number>
ACTUATOR REST Endpoints /beans /autocon fi g /env /mappings - … /health /metrics - ... <number>
WRAP UP Start using Spring Boot today for you Spring Applications! Reduce con fi guration ”noise” dramatically Th ink about what you don’t need to write! Enter the microservice arena the ”easy” way <number>
LINKS 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- fi rst-look-at-spring-boot/ http://callistaenterprise.se/blogg/teknik/2015/10/09/spring-boot-app-as-a- windows-service/ <number>