SlideShare ist ein Scribd-Unternehmen logo
1 von 51
Downloaden Sie, um offline zu lesen
The Spring Update
Roy Clarkson | Glenn Renfro | Gunnar Hillert
Spring
2
Spring Data
3
Core Jpa Gemfire REST
KeyValue MongoDB Redis
Solr
Foundational Store Modules Web Apis
Core
Modules
Community
Modules
Jpa Gemfire
MongoDB Redis
Spring Social
4
Spring 4.2
• @AliasFor
• Hibernate5 Support
• JMS Improvements
• Support for Money, Currency and TimeZone
(Formatter / ConversionService)
5
• Used to declare aliases between attributes
within an annotation
• e.g., locations and value in
@ContextConfiguration, or path and value in
@RequestMapping
• Used in composed annotations
@AliasFor
6
https://github.com/sbrannen/spring-composed
Spring 4.2 Testing
• Support for HtmlUnit incl. Selenium Webdriver
integration
• @Commit instead @Rollback(false)
• ContextCache is public Api
• @Sql
7
@Test
@Sql(statements = "DROP TABLE user IF EXISTS")
@Sql(scripts = “/test-schema.sql", statements =
"INSERT INTO user VALUES ('Dilbert')")
JUnit Rules
• SpringClassRule & SpringMethodRule
• Can be used with any JUnit runner

8
@RunWith(Parameterized.class)
@ContextConfiguration
public class ParameterizedSpringRuleTests {


@ClassRule
public static final SpringClassRule SPRING_CLASS_RULE
= new SpringClassRule();
@Rule
public final SpringMethodRule springMethodRule
= new SpringMethodRule();
Embedded DBs
• Unique Names for Embedded Databases
• Why? Recreating an embedded database within the
same JVM doesn’t actually create anything: a second
attempt simply connects to the existing one.
9
@Bean
public DataSource dataSource() {
return new EmbeddedDatabaseBuilder()
.generateUniqueName(true)
.addScript("schema.sql")
.addScript("user_data.sql")
.build();
}
Spring Web
• SimpUserRegistry
• CompletableFuture (Java 8)
• OkHTTP Integration with RestTemplate
• ScriptTemplateView
• JavaScript view templating, Nashorn (JDK 8)
10
HTTP Caching
• CacheControl builder
• A builder for creating "Cache-Control" HTTP
response headers.
11
@Configuration
@EnableWebMvc
public class WebConfig extends WebMvcConfigurerAdapter {
@Override
public void addResourceHandlers(ResourceHandlerRegistry registry) {
registry.addResourceHandler("/resources/**")
.addResourceLocations("/public-resources/")
.setCacheControl(CacheControl.maxAge(1,TimeUnit.HOURS)
.cachePublic());
}
}
HTTP Caching
12
@RequestMapping("/book/{id}")
public ResponseEntity<Book> showBook(@PathVariable Long id) {
Book book = findBook(id);
String version = book.getVersion();
return ResponseEntity
.ok()
.cacheControl(CacheControl.maxAge(30, TimeUnit.DAYS))
.eTag(version) // lastModified is also available
.body(book);
}
• Usage in Controllers
Spring Web
• Cross-origin resource sharing (CORS)
13
@CrossOrigin(maxAge = 3600)
@RestController
@RequestMapping("/account")
public class AccountController {
@CrossOrigin(origins = "http://domain2.com")
@RequestMapping("/{id}")
public Account retrieve(@PathVariable Long id) { … }
@RequestMapping(method = RequestMethod.DELETE, value = "/{id}")
public void remove(@PathVariable Long id) { … }
}
Async
• Spring 3.2 Async Request Handling
• Spring 4.0 WebSocket Messaging (SockJS +
Stomp)
• Spring 4.2 HttpStreaming
• Spring 4.2 Server-Sent Events (SSE)
• Spring 4.2 Direct Streaming
14
Server-Sent Events
15
@RequestMapping("/metrics")
public SseEmitter subscribeMetrics() {
SseEmitter emitter = new SseEmitter();
// Save emitter for further usage
return emitter;
}
Spring 4.3
• Refinements
• A richer set of convenience annotations (pre-
composed)
16
Spring 5
• Q4 2016
• Comprehensive JDK 9 support
• Java 8 baseline
• Servlet 3.0+
• HTTP/2
• Reactive support
17
https://github.com/spring-
projects/spring-reactive
Spring Boot 1.3
18
Pathway to #NoXML
0
450000
900000
1350000
1800000
July 14 Sep 14 Nov 14 Jan 15 Mar 15 May 15 Jul 15
Spring Boot Adoption
19
• https://spring.io/blog/2013/03/04/spring-at-china-scale-alibaba-
group-alipay-taobao-and-tmall/
20
“AliExpress is the beginning of a new effort to re-
architect Taobao.com and Alipay.com for
microservices and cloud native, built on Spring Boot
and Spring Cloud.”
- Leijuan, Principal Engineer, AliExpress
21
Boot 1.3
• Spring 4.2 and Spring Security 4.0
• OAuth2 Support
• Colorful Ascii Art Banners
22
Boot 1.3
• Fully executable JARs and service support
• Start as Unix/Linux services
• init.d
• systemd
23
$ ./myapp.jar
Boot 1.3
• Additional Health Indicators
• Actuator Metrics (Java 8)
• New actuator endpoints - e.g. /logfile
• Hypermedia for MVC actuator endpoints
• Actuator docs endpoint
24
Boot 1.3
• Spring Session Autoconfiguration
• Persistent sessions (Opt-in)
• Ant Support
• Support for @WebServlet, @WebFilter, and @WebListener
• When using an embedded servlet container, automatic
registration of @WebServlet, @WebFilter, and
@WebListener annotated classes can now be enabled
using @ServletComponentScan.
25
Logging
• Logback
• Spring Profile specific Configuration
• Use Environment Properties in Logback’
• logback-spring.xml
• Log4J 1.x deprecated
26
https://blogs.apache.org/foundation/entry/
apache_logging_services_project_announces
Boot Developer Tools
• Property Defaults
• Automatic application restarts
• Remote development support
27
http://docs.spring.io/spring-boot/docs/current-SNAPSHOT/
reference/htmlsingle/#using-boot-devtools
Boot Developer Tools
• LiveReload support
• Install LiveReload browser plugin
• Bowser Refresh Button
28
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
</dependency>
Caching
• @EnableCaching
• Auto-configuration now for:
29
JSR 107Guava
Boot and SPAs
• Web jars - /webjars/**
• /static, /public, /resources, /META-INF/resources
• Creating modular jars
30
Demo
31
https://github.com/ghillert/botanic-ng
Migrating to 1.3
• https://github.com/spring-projects/spring-boot/
wiki/Spring-Boot-1.3-Release-Notes
• Several properties changed
• Dependency updates
32
JSPs and Web.xml
• JSP limitations for über-Jars
• Servlet 3.0 to the rescue
• /META-INF/resources/WEB-INF/jsp
• Possible to Eliminate Web.xml
• TomcatEmbeddedServletContainerFactory
33
34
Demo
35
https://github.com/devnexus/devnexus-site
JSPs with
Spring Initializr
• http://start.spring.io
36
Tooling - STS
• Spring Boot YML properties editor
• with code completion
• Improved support for Cloud Foundry
• Support for Spring Boot DevTools
• Attach Java debugger to CF deployed apps
• Spring Boot Dashboard
37
• Service Discovery
• Circuit Breaker
• Client Side Load Balancer
• Router and Filter
• Spring Cloud Stream + Data Flow
• Distributed tracing
38
Spring Cloud
39
Eureka
Hystrix
Spring Cloud
Consul
12 factor app principles
40
Codebase
Depen-
dencies
Config
Backing
Services
Build
Release
Run
Processes
Port
Binding
Concurrency
Disposa-
bility
Dev/Prod
Parity
Logs
Admin
Processes
http://12factor.net
Demo
41
https://github.com/springone2gx2015/vehicle-fleet-demo
Demo
42
Spring & Cloud Native
43
Core Boot
Connectors Service
Registry
Config
Server
Circuit
Breaker
OpsDev
44
#fundJUnit
• Pivotal sponsoring JUnit
• Developer Sponsor
• 6 weeks of senior developer
• Campaign Sponsor
• €5000 donation
Books
45
http://pivotal.io/
platform/migrating-to-
cloud-native-
application-
architectures-ebook
Books
46
Books
47
48
• Full-Day Workshop
• Several Spring Speakers
49
Delivering Cloud Native
Applications with Spring
and Cloud Foundry
Questions?
50
Thank You!
51
Credits:
Justin Blake, nathanbui, Bohdan Burmich, David Waschbüsch, Gabriele Malaspina, Creative Stall, Aha-Soft
https://github.com/ghillert/
ajug-spring-update
@ghillert @royclarkson@cppwfs
@springcentral

Weitere ähnliche Inhalte

Was ist angesagt?

Don't Wait! Develop Responsive Applications with Java EE7 Instead
Don't Wait! Develop Responsive Applications with Java EE7 InsteadDon't Wait! Develop Responsive Applications with Java EE7 Instead
Don't Wait! Develop Responsive Applications with Java EE7 InsteadWASdev Community
 
06 integrate elasticsearch
06 integrate elasticsearch06 integrate elasticsearch
06 integrate elasticsearchErhwen Kuo
 
04 integrate entityframework
04 integrate entityframework04 integrate entityframework
04 integrate entityframeworkErhwen Kuo
 
01 startoff angularjs
01 startoff angularjs01 startoff angularjs
01 startoff angularjsErhwen Kuo
 
02 integrate highchart
02 integrate highchart02 integrate highchart
02 integrate highchartErhwen Kuo
 
Using ActiveObjects in Atlassian Plugins
Using ActiveObjects in Atlassian PluginsUsing ActiveObjects in Atlassian Plugins
Using ActiveObjects in Atlassian PluginsAtlassian
 
Spring boot for buidling microservices
Spring boot for buidling microservicesSpring boot for buidling microservices
Spring boot for buidling microservicesNilanjan Roy
 
Spring boot Introduction
Spring boot IntroductionSpring boot Introduction
Spring boot IntroductionJeevesh Pandey
 
Grails Plugin Best Practices
Grails Plugin Best PracticesGrails Plugin Best Practices
Grails Plugin Best PracticesBurt Beckwith
 
Atlanta JUG - Integrating Spring Batch and Spring Integration
Atlanta JUG - Integrating Spring Batch and Spring IntegrationAtlanta JUG - Integrating Spring Batch and Spring Integration
Atlanta JUG - Integrating Spring Batch and Spring IntegrationGunnar Hillert
 
All your data belong to us - The Active Objects Plugin
All your data belong to us - The Active Objects PluginAll your data belong to us - The Active Objects Plugin
All your data belong to us - The Active Objects PluginSamuel Le Berrigaud
 
Java springboot microservice - Accenture Technology Meetup
Java springboot microservice - Accenture Technology MeetupJava springboot microservice - Accenture Technology Meetup
Java springboot microservice - Accenture Technology MeetupAccenture Hungary
 
05 integrate redis
05 integrate redis05 integrate redis
05 integrate redisErhwen Kuo
 
PUC SE Day 2019 - SpringBoot
PUC SE Day 2019 - SpringBootPUC SE Day 2019 - SpringBoot
PUC SE Day 2019 - SpringBootJosué Neis
 
Modularizing your Grails Application with Private Plugins - SpringOne 2GX 2012
Modularizing your Grails Application with Private Plugins - SpringOne 2GX 2012Modularizing your Grails Application with Private Plugins - SpringOne 2GX 2012
Modularizing your Grails Application with Private Plugins - SpringOne 2GX 2012kennethaliu
 
Dropwizard Internals
Dropwizard InternalsDropwizard Internals
Dropwizard Internalscarlo-rtr
 
Spring Boot Actuator 2.0 & Micrometer
Spring Boot Actuator 2.0 & MicrometerSpring Boot Actuator 2.0 & Micrometer
Spring Boot Actuator 2.0 & MicrometerToshiaki Maki
 
My "Perfect" Toolchain Setup for Grails Projects
My "Perfect" Toolchain Setup for Grails ProjectsMy "Perfect" Toolchain Setup for Grails Projects
My "Perfect" Toolchain Setup for Grails ProjectsGR8Conf
 
Tips and Tricks For Faster Asp.NET and MVC Applications
Tips and Tricks For Faster Asp.NET and MVC ApplicationsTips and Tricks For Faster Asp.NET and MVC Applications
Tips and Tricks For Faster Asp.NET and MVC ApplicationsSarvesh Kushwaha
 

Was ist angesagt? (20)

Don't Wait! Develop Responsive Applications with Java EE7 Instead
Don't Wait! Develop Responsive Applications with Java EE7 InsteadDon't Wait! Develop Responsive Applications with Java EE7 Instead
Don't Wait! Develop Responsive Applications with Java EE7 Instead
 
06 integrate elasticsearch
06 integrate elasticsearch06 integrate elasticsearch
06 integrate elasticsearch
 
04 integrate entityframework
04 integrate entityframework04 integrate entityframework
04 integrate entityframework
 
01 startoff angularjs
01 startoff angularjs01 startoff angularjs
01 startoff angularjs
 
02 integrate highchart
02 integrate highchart02 integrate highchart
02 integrate highchart
 
Using ActiveObjects in Atlassian Plugins
Using ActiveObjects in Atlassian PluginsUsing ActiveObjects in Atlassian Plugins
Using ActiveObjects in Atlassian Plugins
 
Spring boot for buidling microservices
Spring boot for buidling microservicesSpring boot for buidling microservices
Spring boot for buidling microservices
 
Spring boot Introduction
Spring boot IntroductionSpring boot Introduction
Spring boot Introduction
 
Grails Plugin Best Practices
Grails Plugin Best PracticesGrails Plugin Best Practices
Grails Plugin Best Practices
 
Atlanta JUG - Integrating Spring Batch and Spring Integration
Atlanta JUG - Integrating Spring Batch and Spring IntegrationAtlanta JUG - Integrating Spring Batch and Spring Integration
Atlanta JUG - Integrating Spring Batch and Spring Integration
 
All your data belong to us - The Active Objects Plugin
All your data belong to us - The Active Objects PluginAll your data belong to us - The Active Objects Plugin
All your data belong to us - The Active Objects Plugin
 
Java springboot microservice - Accenture Technology Meetup
Java springboot microservice - Accenture Technology MeetupJava springboot microservice - Accenture Technology Meetup
Java springboot microservice - Accenture Technology Meetup
 
05 integrate redis
05 integrate redis05 integrate redis
05 integrate redis
 
PUC SE Day 2019 - SpringBoot
PUC SE Day 2019 - SpringBootPUC SE Day 2019 - SpringBoot
PUC SE Day 2019 - SpringBoot
 
Modularizing your Grails Application with Private Plugins - SpringOne 2GX 2012
Modularizing your Grails Application with Private Plugins - SpringOne 2GX 2012Modularizing your Grails Application with Private Plugins - SpringOne 2GX 2012
Modularizing your Grails Application with Private Plugins - SpringOne 2GX 2012
 
Dropwizard Internals
Dropwizard InternalsDropwizard Internals
Dropwizard Internals
 
Spring Boot Actuator 2.0 & Micrometer
Spring Boot Actuator 2.0 & MicrometerSpring Boot Actuator 2.0 & Micrometer
Spring Boot Actuator 2.0 & Micrometer
 
My "Perfect" Toolchain Setup for Grails Projects
My "Perfect" Toolchain Setup for Grails ProjectsMy "Perfect" Toolchain Setup for Grails Projects
My "Perfect" Toolchain Setup for Grails Projects
 
Iac d.damyanov 4.pptx
Iac d.damyanov 4.pptxIac d.damyanov 4.pptx
Iac d.damyanov 4.pptx
 
Tips and Tricks For Faster Asp.NET and MVC Applications
Tips and Tricks For Faster Asp.NET and MVC ApplicationsTips and Tricks For Faster Asp.NET and MVC Applications
Tips and Tricks For Faster Asp.NET and MVC Applications
 

Ähnlich wie Ajug - The Spring Update

Spring 3.1 to 3.2 in a Nutshell - Spring I/O 2012
Spring 3.1 to 3.2 in a Nutshell - Spring I/O 2012Spring 3.1 to 3.2 in a Nutshell - Spring I/O 2012
Spring 3.1 to 3.2 in a Nutshell - Spring I/O 2012Sam Brannen
 
Spring 3.1 in a Nutshell - JAX London 2011
Spring 3.1 in a Nutshell - JAX London 2011Spring 3.1 in a Nutshell - JAX London 2011
Spring 3.1 in a Nutshell - JAX London 2011Sam Brannen
 
Spring Day | Spring 3.1 in a Nutshell | Sam Brannen
Spring Day | Spring 3.1 in a Nutshell | Sam BrannenSpring Day | Spring 3.1 in a Nutshell | Sam Brannen
Spring Day | Spring 3.1 in a Nutshell | Sam BrannenJAX London
 
Tutorial, Part 2: SharePoint 101: Jump-Starting the Developer by Rob Windsor ...
Tutorial, Part 2: SharePoint 101: Jump-Starting the Developer by Rob Windsor ...Tutorial, Part 2: SharePoint 101: Jump-Starting the Developer by Rob Windsor ...
Tutorial, Part 2: SharePoint 101: Jump-Starting the Developer by Rob Windsor ...SPTechCon
 
Native Support of Prometheus Monitoring in Apache Spark 3.0
Native Support of Prometheus Monitoring in Apache Spark 3.0Native Support of Prometheus Monitoring in Apache Spark 3.0
Native Support of Prometheus Monitoring in Apache Spark 3.0Databricks
 
Spring5 New Features
Spring5 New FeaturesSpring5 New Features
Spring5 New FeaturesJay Lee
 
Java colombo-deep-dive-into-jax-rs
Java colombo-deep-dive-into-jax-rsJava colombo-deep-dive-into-jax-rs
Java colombo-deep-dive-into-jax-rsSagara Gunathunga
 
Webinar: What's new in CDAP 3.5?
Webinar: What's new in CDAP 3.5?Webinar: What's new in CDAP 3.5?
Webinar: What's new in CDAP 3.5?Cask Data
 
Spring MVC to iOS and the REST
Spring MVC to iOS and the RESTSpring MVC to iOS and the REST
Spring MVC to iOS and the RESTRoy Clarkson
 
Are you getting Sleepy. REST in SharePoint Apps
Are you getting Sleepy. REST in SharePoint AppsAre you getting Sleepy. REST in SharePoint Apps
Are you getting Sleepy. REST in SharePoint AppsLiam Cleary [MVP]
 
What’s New in Spring Batch?
What’s New in Spring Batch?What’s New in Spring Batch?
What’s New in Spring Batch?VMware Tanzu
 
Spring Framework 3.2 - What's New
Spring Framework 3.2 - What's NewSpring Framework 3.2 - What's New
Spring Framework 3.2 - What's NewSam Brannen
 
Staying Sane with Drupal NEPHP
Staying Sane with Drupal NEPHPStaying Sane with Drupal NEPHP
Staying Sane with Drupal NEPHPOscar Merida
 
Greach 2014 - Road to Grails 3.0
Greach 2014  - Road to Grails 3.0Greach 2014  - Road to Grails 3.0
Greach 2014 - Road to Grails 3.0graemerocher
 
Java EE 8 Update
Java EE 8 UpdateJava EE 8 Update
Java EE 8 UpdateRyan Cuprak
 

Ähnlich wie Ajug - The Spring Update (20)

Get ready for spring 4
Get ready for spring 4Get ready for spring 4
Get ready for spring 4
 
What's new in the July 2017 Update for Dynamics 365 - Developer features
What's new in the July 2017 Update for Dynamics 365 - Developer featuresWhat's new in the July 2017 Update for Dynamics 365 - Developer features
What's new in the July 2017 Update for Dynamics 365 - Developer features
 
Spring 3.1 to 3.2 in a Nutshell - Spring I/O 2012
Spring 3.1 to 3.2 in a Nutshell - Spring I/O 2012Spring 3.1 to 3.2 in a Nutshell - Spring I/O 2012
Spring 3.1 to 3.2 in a Nutshell - Spring I/O 2012
 
Spring 3.1 in a Nutshell - JAX London 2011
Spring 3.1 in a Nutshell - JAX London 2011Spring 3.1 in a Nutshell - JAX London 2011
Spring 3.1 in a Nutshell - JAX London 2011
 
Spring Day | Spring 3.1 in a Nutshell | Sam Brannen
Spring Day | Spring 3.1 in a Nutshell | Sam BrannenSpring Day | Spring 3.1 in a Nutshell | Sam Brannen
Spring Day | Spring 3.1 in a Nutshell | Sam Brannen
 
Tutorial, Part 2: SharePoint 101: Jump-Starting the Developer by Rob Windsor ...
Tutorial, Part 2: SharePoint 101: Jump-Starting the Developer by Rob Windsor ...Tutorial, Part 2: SharePoint 101: Jump-Starting the Developer by Rob Windsor ...
Tutorial, Part 2: SharePoint 101: Jump-Starting the Developer by Rob Windsor ...
 
Native Support of Prometheus Monitoring in Apache Spark 3.0
Native Support of Prometheus Monitoring in Apache Spark 3.0Native Support of Prometheus Monitoring in Apache Spark 3.0
Native Support of Prometheus Monitoring in Apache Spark 3.0
 
Java EE 8
Java EE 8Java EE 8
Java EE 8
 
Spring5 New Features
Spring5 New FeaturesSpring5 New Features
Spring5 New Features
 
REST easy with API Platform
REST easy with API PlatformREST easy with API Platform
REST easy with API Platform
 
Java colombo-deep-dive-into-jax-rs
Java colombo-deep-dive-into-jax-rsJava colombo-deep-dive-into-jax-rs
Java colombo-deep-dive-into-jax-rs
 
Webinar: What's new in CDAP 3.5?
Webinar: What's new in CDAP 3.5?Webinar: What's new in CDAP 3.5?
Webinar: What's new in CDAP 3.5?
 
JSF2
JSF2JSF2
JSF2
 
Spring MVC to iOS and the REST
Spring MVC to iOS and the RESTSpring MVC to iOS and the REST
Spring MVC to iOS and the REST
 
Are you getting Sleepy. REST in SharePoint Apps
Are you getting Sleepy. REST in SharePoint AppsAre you getting Sleepy. REST in SharePoint Apps
Are you getting Sleepy. REST in SharePoint Apps
 
What’s New in Spring Batch?
What’s New in Spring Batch?What’s New in Spring Batch?
What’s New in Spring Batch?
 
Spring Framework 3.2 - What's New
Spring Framework 3.2 - What's NewSpring Framework 3.2 - What's New
Spring Framework 3.2 - What's New
 
Staying Sane with Drupal NEPHP
Staying Sane with Drupal NEPHPStaying Sane with Drupal NEPHP
Staying Sane with Drupal NEPHP
 
Greach 2014 - Road to Grails 3.0
Greach 2014  - Road to Grails 3.0Greach 2014  - Road to Grails 3.0
Greach 2014 - Road to Grails 3.0
 
Java EE 8 Update
Java EE 8 UpdateJava EE 8 Update
Java EE 8 Update
 

Mehr von Gunnar Hillert

High Precision GPS Positioning for Spring Developers
High Precision GPS Positioning for Spring DevelopersHigh Precision GPS Positioning for Spring Developers
High Precision GPS Positioning for Spring DevelopersGunnar Hillert
 
Migrating to Angular 5 for Spring Developers
Migrating to Angular 5 for Spring DevelopersMigrating to Angular 5 for Spring Developers
Migrating to Angular 5 for Spring DevelopersGunnar Hillert
 
s2gx2015 who needs batch
s2gx2015 who needs batchs2gx2015 who needs batch
s2gx2015 who needs batchGunnar Hillert
 
DevNexus 2013 - Introduction to WebSockets
DevNexus 2013 - Introduction to WebSocketsDevNexus 2013 - Introduction to WebSockets
DevNexus 2013 - Introduction to WebSocketsGunnar Hillert
 
Introduction to WebSockets
Introduction to WebSocketsIntroduction to WebSockets
Introduction to WebSocketsGunnar Hillert
 
S2GX 2012 - What's New in Spring Integration
S2GX 2012 - What's New in Spring IntegrationS2GX 2012 - What's New in Spring Integration
S2GX 2012 - What's New in Spring IntegrationGunnar Hillert
 
S2GX 2012 - Introduction to Spring Integration and Spring Batch
S2GX 2012 - Introduction to Spring Integration and Spring BatchS2GX 2012 - Introduction to Spring Integration and Spring Batch
S2GX 2012 - Introduction to Spring Integration and Spring BatchGunnar Hillert
 
Cloud Foundry for Spring Developers
Cloud Foundry for Spring DevelopersCloud Foundry for Spring Developers
Cloud Foundry for Spring DevelopersGunnar Hillert
 
jRecruiter - The AJUG Job Posting Service
jRecruiter - The AJUG Job Posting ServicejRecruiter - The AJUG Job Posting Service
jRecruiter - The AJUG Job Posting ServiceGunnar Hillert
 

Mehr von Gunnar Hillert (9)

High Precision GPS Positioning for Spring Developers
High Precision GPS Positioning for Spring DevelopersHigh Precision GPS Positioning for Spring Developers
High Precision GPS Positioning for Spring Developers
 
Migrating to Angular 5 for Spring Developers
Migrating to Angular 5 for Spring DevelopersMigrating to Angular 5 for Spring Developers
Migrating to Angular 5 for Spring Developers
 
s2gx2015 who needs batch
s2gx2015 who needs batchs2gx2015 who needs batch
s2gx2015 who needs batch
 
DevNexus 2013 - Introduction to WebSockets
DevNexus 2013 - Introduction to WebSocketsDevNexus 2013 - Introduction to WebSockets
DevNexus 2013 - Introduction to WebSockets
 
Introduction to WebSockets
Introduction to WebSocketsIntroduction to WebSockets
Introduction to WebSockets
 
S2GX 2012 - What's New in Spring Integration
S2GX 2012 - What's New in Spring IntegrationS2GX 2012 - What's New in Spring Integration
S2GX 2012 - What's New in Spring Integration
 
S2GX 2012 - Introduction to Spring Integration and Spring Batch
S2GX 2012 - Introduction to Spring Integration and Spring BatchS2GX 2012 - Introduction to Spring Integration and Spring Batch
S2GX 2012 - Introduction to Spring Integration and Spring Batch
 
Cloud Foundry for Spring Developers
Cloud Foundry for Spring DevelopersCloud Foundry for Spring Developers
Cloud Foundry for Spring Developers
 
jRecruiter - The AJUG Job Posting Service
jRecruiter - The AJUG Job Posting ServicejRecruiter - The AJUG Job Posting Service
jRecruiter - The AJUG Job Posting Service
 

Kürzlich hochgeladen

Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 

Kürzlich hochgeladen (20)

Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 

Ajug - The Spring Update

  • 1. The Spring Update Roy Clarkson | Glenn Renfro | Gunnar Hillert
  • 3. Spring Data 3 Core Jpa Gemfire REST KeyValue MongoDB Redis Solr Foundational Store Modules Web Apis Core Modules Community Modules Jpa Gemfire MongoDB Redis
  • 5. Spring 4.2 • @AliasFor • Hibernate5 Support • JMS Improvements • Support for Money, Currency and TimeZone (Formatter / ConversionService) 5
  • 6. • Used to declare aliases between attributes within an annotation • e.g., locations and value in @ContextConfiguration, or path and value in @RequestMapping • Used in composed annotations @AliasFor 6 https://github.com/sbrannen/spring-composed
  • 7. Spring 4.2 Testing • Support for HtmlUnit incl. Selenium Webdriver integration • @Commit instead @Rollback(false) • ContextCache is public Api • @Sql 7 @Test @Sql(statements = "DROP TABLE user IF EXISTS") @Sql(scripts = “/test-schema.sql", statements = "INSERT INTO user VALUES ('Dilbert')")
  • 8. JUnit Rules • SpringClassRule & SpringMethodRule • Can be used with any JUnit runner
 8 @RunWith(Parameterized.class) @ContextConfiguration public class ParameterizedSpringRuleTests { 
 @ClassRule public static final SpringClassRule SPRING_CLASS_RULE = new SpringClassRule(); @Rule public final SpringMethodRule springMethodRule = new SpringMethodRule();
  • 9. Embedded DBs • Unique Names for Embedded Databases • Why? Recreating an embedded database within the same JVM doesn’t actually create anything: a second attempt simply connects to the existing one. 9 @Bean public DataSource dataSource() { return new EmbeddedDatabaseBuilder() .generateUniqueName(true) .addScript("schema.sql") .addScript("user_data.sql") .build(); }
  • 10. Spring Web • SimpUserRegistry • CompletableFuture (Java 8) • OkHTTP Integration with RestTemplate • ScriptTemplateView • JavaScript view templating, Nashorn (JDK 8) 10
  • 11. HTTP Caching • CacheControl builder • A builder for creating "Cache-Control" HTTP response headers. 11 @Configuration @EnableWebMvc public class WebConfig extends WebMvcConfigurerAdapter { @Override public void addResourceHandlers(ResourceHandlerRegistry registry) { registry.addResourceHandler("/resources/**") .addResourceLocations("/public-resources/") .setCacheControl(CacheControl.maxAge(1,TimeUnit.HOURS) .cachePublic()); } }
  • 12. HTTP Caching 12 @RequestMapping("/book/{id}") public ResponseEntity<Book> showBook(@PathVariable Long id) { Book book = findBook(id); String version = book.getVersion(); return ResponseEntity .ok() .cacheControl(CacheControl.maxAge(30, TimeUnit.DAYS)) .eTag(version) // lastModified is also available .body(book); } • Usage in Controllers
  • 13. Spring Web • Cross-origin resource sharing (CORS) 13 @CrossOrigin(maxAge = 3600) @RestController @RequestMapping("/account") public class AccountController { @CrossOrigin(origins = "http://domain2.com") @RequestMapping("/{id}") public Account retrieve(@PathVariable Long id) { … } @RequestMapping(method = RequestMethod.DELETE, value = "/{id}") public void remove(@PathVariable Long id) { … } }
  • 14. Async • Spring 3.2 Async Request Handling • Spring 4.0 WebSocket Messaging (SockJS + Stomp) • Spring 4.2 HttpStreaming • Spring 4.2 Server-Sent Events (SSE) • Spring 4.2 Direct Streaming 14
  • 15. Server-Sent Events 15 @RequestMapping("/metrics") public SseEmitter subscribeMetrics() { SseEmitter emitter = new SseEmitter(); // Save emitter for further usage return emitter; }
  • 16. Spring 4.3 • Refinements • A richer set of convenience annotations (pre- composed) 16
  • 17. Spring 5 • Q4 2016 • Comprehensive JDK 9 support • Java 8 baseline • Servlet 3.0+ • HTTP/2 • Reactive support 17 https://github.com/spring- projects/spring-reactive
  • 19. 0 450000 900000 1350000 1800000 July 14 Sep 14 Nov 14 Jan 15 Mar 15 May 15 Jul 15 Spring Boot Adoption 19
  • 20. • https://spring.io/blog/2013/03/04/spring-at-china-scale-alibaba- group-alipay-taobao-and-tmall/ 20 “AliExpress is the beginning of a new effort to re- architect Taobao.com and Alipay.com for microservices and cloud native, built on Spring Boot and Spring Cloud.” - Leijuan, Principal Engineer, AliExpress
  • 21. 21
  • 22. Boot 1.3 • Spring 4.2 and Spring Security 4.0 • OAuth2 Support • Colorful Ascii Art Banners 22
  • 23. Boot 1.3 • Fully executable JARs and service support • Start as Unix/Linux services • init.d • systemd 23 $ ./myapp.jar
  • 24. Boot 1.3 • Additional Health Indicators • Actuator Metrics (Java 8) • New actuator endpoints - e.g. /logfile • Hypermedia for MVC actuator endpoints • Actuator docs endpoint 24
  • 25. Boot 1.3 • Spring Session Autoconfiguration • Persistent sessions (Opt-in) • Ant Support • Support for @WebServlet, @WebFilter, and @WebListener • When using an embedded servlet container, automatic registration of @WebServlet, @WebFilter, and @WebListener annotated classes can now be enabled using @ServletComponentScan. 25
  • 26. Logging • Logback • Spring Profile specific Configuration • Use Environment Properties in Logback’ • logback-spring.xml • Log4J 1.x deprecated 26 https://blogs.apache.org/foundation/entry/ apache_logging_services_project_announces
  • 27. Boot Developer Tools • Property Defaults • Automatic application restarts • Remote development support 27 http://docs.spring.io/spring-boot/docs/current-SNAPSHOT/ reference/htmlsingle/#using-boot-devtools
  • 28. Boot Developer Tools • LiveReload support • Install LiveReload browser plugin • Bowser Refresh Button 28 <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-devtools</artifactId> </dependency>
  • 30. Boot and SPAs • Web jars - /webjars/** • /static, /public, /resources, /META-INF/resources • Creating modular jars 30
  • 32. Migrating to 1.3 • https://github.com/spring-projects/spring-boot/ wiki/Spring-Boot-1.3-Release-Notes • Several properties changed • Dependency updates 32
  • 33. JSPs and Web.xml • JSP limitations for über-Jars • Servlet 3.0 to the rescue • /META-INF/resources/WEB-INF/jsp • Possible to Eliminate Web.xml • TomcatEmbeddedServletContainerFactory 33
  • 34. 34
  • 37. Tooling - STS • Spring Boot YML properties editor • with code completion • Improved support for Cloud Foundry • Support for Spring Boot DevTools • Attach Java debugger to CF deployed apps • Spring Boot Dashboard 37
  • 38. • Service Discovery • Circuit Breaker • Client Side Load Balancer • Router and Filter • Spring Cloud Stream + Data Flow • Distributed tracing 38 Spring Cloud
  • 40. 12 factor app principles 40 Codebase Depen- dencies Config Backing Services Build Release Run Processes Port Binding Concurrency Disposa- bility Dev/Prod Parity Logs Admin Processes http://12factor.net
  • 43. Spring & Cloud Native 43 Core Boot Connectors Service Registry Config Server Circuit Breaker OpsDev
  • 44. 44 #fundJUnit • Pivotal sponsoring JUnit • Developer Sponsor • 6 weeks of senior developer • Campaign Sponsor • €5000 donation
  • 48. 48
  • 49. • Full-Day Workshop • Several Spring Speakers 49 Delivering Cloud Native Applications with Spring and Cloud Foundry
  • 51. Thank You! 51 Credits: Justin Blake, nathanbui, Bohdan Burmich, David Waschbüsch, Gabriele Malaspina, Creative Stall, Aha-Soft https://github.com/ghillert/ ajug-spring-update @ghillert @royclarkson@cppwfs @springcentral