getting started with spring boot

19
Getting Started with Spring Boot by David Kiss

Upload: david-kiss

Post on 17-Jul-2015

114 views

Category:

Software


3 download

TRANSCRIPT

Getting Started with Spring Bootby David Kiss

Agenda

• What is Spring Boot?

• Configuration

• DB versioning with Liquibase

• Health checks

• Admin tasks

• Tracing HTTP requests

• Stand-alone jar

What is Spring Boot

• Spring Boot makes it easy to get started with building web applications with minimum fuss

• Provides out-of-the-box features like embedded servlet container, security, metrics, health checks, externalized configuration)

• No code generation

• No requirement for XML configuration.

Built on the Spring Platform

Why Using Spring Boot?• Productivity

– Convention over configuration

– Designed to get you up and running as quickly as possible (http://start.spring.io/)

– Built on top of Spring Framework - wide range of supported technologies & frameworks

• Cleaner code– Inversion of Control

– Easy to write tests

– Less boilerplate code

• Running in production– Supports the Microservice Architecture (http://microservices.io/)

– Automated DB upgrades using Liquibase (http://www.liquibase.org/) and Flyway (http://flywaydb.org/)

– Spring Cloud support (http://projects.spring.io/spring-cloud/) - distributed configuration management, service discovery, circuit breakers, intelligent routing, etc.

– Eliminates need to manage & tweak application servers

How We Benefit From Spring Boot?

• Increased developer productivity

• Ease of deployment

• Support from large and active community

Configuration – Hello World!

Configuration – Application class

No XML configuration is required

Configuration – application.yaml

Environment-aware configuration

Configuration – build.properties

Jenkins populates the params

Configuration – Build Info

GET http://localhost:8081/manage/info

Health-checks – Custom Indicators

Health-checks – In Action

GET http://localhost:8081/manage/health

Admin Tasks (for internal access)

PUT http://localhost:8081/manage/create-user

Tracing HTTP requests

GET http://localhost:8081/manage/trace

Stand-alone jar – pom.xml

$ mvn package

Stand-alone jar – Start up

Q&A