Slide 1

Slide 1 text

Madhura Bhave @madhurabhave23 WHAT’S NEW IN SPRING BOOT 2.0

Slide 2

Slide 2 text

Agenda •What’s New • Infrastructure Upgrades • Spring Framework 5 • Micrometer Support •What’s Changed • Configuration Properties • Actuator Endpoints • Security

Slide 3

Slide 3 text

What’s New •Infrastructure upgrades •Spring Framework 5 •Micrometer Support

Slide 4

Slide 4 text

Infrastructure upgrades 8+ 8+ 5.2 3

Slide 5

Slide 5 text

What’s New •Infrastructure upgrades •Spring Framework 5 •Micrometer Support

Slide 6

Slide 6 text

Reactive Spring •Blocking • Large thread pool required • Each request gets its own thread •Non-Blocking • Small thread pool • Worker threads process events

Slide 7

Slide 7 text

Reactive Spring •Servlet Stack • Servlet Container • Servlet API • Spring MVC •Reactive Stack • Netty, Servlet 3.1 • Reactive HTTP layer • Spring WebFlux

Slide 8

Slide 8 text

DEMO

Slide 9

Slide 9 text

Reactive Spring •Non-blocking •Event loop at the center •More for scalability than speed •You can still use Spring MVC

Slide 10

Slide 10 text

What’s New •Infrastructure upgrades •Spring Framework 5 •Micrometer Support

Slide 11

Slide 11 text

MICROMETER SUPPORT •Auto-configuration for metrics instrumentation library - Micrometer •Hierarchical metrics replaced by dimensional metrics •Facade over multiple monitoring systems

Slide 12

Slide 12 text

DEMO

Slide 13

Slide 13 text

What’s changed •Configuration properties •Actuator Endpoints •Security

Slide 14

Slide 14 text

DEMO

Slide 15

Slide 15 text

Configuration Properties •Relaxed Binding rules stay the same •Uniform format for reading properties from the environment • Elements separated by dots • Must be alpha-numeric • Must be lowercase • Hyphen can be used to separate words my.foo.hello-world my.foo.helloWorld my.foo.hello_world my.foo.helloworld

Slide 16

Slide 16 text

Configuration Properties •Indices in environment variables • my_foo_1 my.foo[1] • my_foo_1_2 my.foo[1][2] •Consistent behavior for Collections •Better types, e.g. Duration “1s” “2m” “5d” •Origin support

Slide 17

Slide 17 text

Properties Migrator org.springframework.boot spring-boot-properties-migrator runtime

Slide 18

Slide 18 text

What’s changed •Configuration properties •Actuator Endpoints •Security

Slide 19

Slide 19 text

DEMO

Slide 20

Slide 20 text

Actuator Endpoints •Endpoint annotations • @Endpoint, @WebEndpoint, @JmxEndpoint •Tech independent operations • @ReadOperation, @WriteOperation, @DeleteOperation •Tech specific extensions • @EndpointWebExtension, @EndpointJmxExtension https://2018.springio.net/sessions/mastering-spring-boots-actuator

Slide 21

Slide 21 text

Actuator Endpoints •Works with: • Spring MVC • Spring WebFlux • Jersey •Reactive Health Indicators •Overhaul of the “/actuator/mappings” & “/actuator/trace” endpoints

Slide 22

Slide 22 text

What’s changed •Configuration properties •Actuator Endpoints •Security

Slide 23

Slide 23 text

Security •Simpler security auto-configuration •Auto-configuration backs-off easily •Adding custom security is easy •No ordering issues with `WebSecurityConfigurerAdapter` •RequestMatchers for static resources and actuators •Auto-configuration for reactive security

Slide 24

Slide 24 text

Security •OAuth 2.0 • Moving to Spring Security 5.0 • Support for multiple client registrations • Authorization Server/Resource Server support https://github.com/spring-projects/spring-security-oauth2-boot

Slide 25

Slide 25 text

Links •https://github.com/mbhave/webflux-demo •https://github.com/mbhave/configuration-properties-demo •https://github.com/mbhave/actuator-demo •https://github.com/spring-projects/spring-boot/wiki/Spring- Boot-2.0-Migration-Guide

Slide 26

Slide 26 text

Madhura Bhave @madhurabhave23 THANKS!