SlideShare uma empresa Scribd logo
1 de 51
Baixar para ler offline
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
ElasticSearch Cassandra
Couchbase Neo4j
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

Mais conteúdo relacionado

Mais procurados

04 integrate entityframework
04 integrate entityframework04 integrate entityframework
04 integrate entityframeworkErhwen Kuo
 
06 integrate elasticsearch
06 integrate elasticsearch06 integrate elasticsearch
06 integrate elasticsearchErhwen Kuo
 
01 startoff angularjs
01 startoff angularjs01 startoff angularjs
01 startoff angularjsErhwen Kuo
 
Using ActiveObjects in Atlassian Plugins
Using ActiveObjects in Atlassian PluginsUsing ActiveObjects in Atlassian Plugins
Using ActiveObjects in Atlassian PluginsAtlassian
 
Powershell For Developers
Powershell For DevelopersPowershell For Developers
Powershell For DevelopersIdo Flatow
 
Spring boot Introduction
Spring boot IntroductionSpring boot Introduction
Spring boot IntroductionJeevesh Pandey
 
AAI 2236-Using the New Java Concurrency Utilities with IBM WebSphere
AAI 2236-Using the New Java Concurrency Utilities with IBM WebSphereAAI 2236-Using the New Java Concurrency Utilities with IBM WebSphere
AAI 2236-Using the New Java Concurrency Utilities with IBM WebSphereKevin Sutter
 
PUC SE Day 2019 - SpringBoot
PUC SE Day 2019 - SpringBootPUC SE Day 2019 - SpringBoot
PUC SE Day 2019 - SpringBootJosué Neis
 
Inside Azure Diagnostics
Inside Azure DiagnosticsInside Azure Diagnostics
Inside Azure DiagnosticsMichael Collier
 
Build Amazing Add-ons for Atlassian JIRA and Confluence
Build Amazing Add-ons for Atlassian JIRA and ConfluenceBuild Amazing Add-ons for Atlassian JIRA and Confluence
Build Amazing Add-ons for Atlassian JIRA and ConfluenceK15t
 
Java springboot microservice - Accenture Technology Meetup
Java springboot microservice - Accenture Technology MeetupJava springboot microservice - Accenture Technology Meetup
Java springboot microservice - Accenture Technology MeetupAccenture Hungary
 
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
 
Dropwizard Internals
Dropwizard InternalsDropwizard Internals
Dropwizard Internalscarlo-rtr
 
REST APIs with Spring
REST APIs with SpringREST APIs with Spring
REST APIs with SpringJoshua Long
 
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
 
RESTful web apps with Apache Sling - 2013 version
RESTful web apps with Apache Sling - 2013 versionRESTful web apps with Apache Sling - 2013 version
RESTful web apps with Apache Sling - 2013 versionBertrand Delacretaz
 
Automating Your Microsoft Azure Environment (DevLink 2014)
Automating Your Microsoft Azure Environment (DevLink 2014)Automating Your Microsoft Azure Environment (DevLink 2014)
Automating Your Microsoft Azure Environment (DevLink 2014)Michael Collier
 
Build Your Own CMS with Apache Sling
Build Your Own CMS with Apache SlingBuild Your Own CMS with Apache Sling
Build Your Own CMS with Apache SlingBob Paulin
 

Mais procurados (20)

04 integrate entityframework
04 integrate entityframework04 integrate entityframework
04 integrate entityframework
 
06 integrate elasticsearch
06 integrate elasticsearch06 integrate elasticsearch
06 integrate elasticsearch
 
01 startoff angularjs
01 startoff angularjs01 startoff angularjs
01 startoff angularjs
 
Using ActiveObjects in Atlassian Plugins
Using ActiveObjects in Atlassian PluginsUsing ActiveObjects in Atlassian Plugins
Using ActiveObjects in Atlassian Plugins
 
Powershell For Developers
Powershell For DevelopersPowershell For Developers
Powershell For Developers
 
Spring boot Introduction
Spring boot IntroductionSpring boot Introduction
Spring boot Introduction
 
AAI 2236-Using the New Java Concurrency Utilities with IBM WebSphere
AAI 2236-Using the New Java Concurrency Utilities with IBM WebSphereAAI 2236-Using the New Java Concurrency Utilities with IBM WebSphere
AAI 2236-Using the New Java Concurrency Utilities with IBM WebSphere
 
PUC SE Day 2019 - SpringBoot
PUC SE Day 2019 - SpringBootPUC SE Day 2019 - SpringBoot
PUC SE Day 2019 - SpringBoot
 
Inside Azure Diagnostics
Inside Azure DiagnosticsInside Azure Diagnostics
Inside Azure Diagnostics
 
Build Amazing Add-ons for Atlassian JIRA and Confluence
Build Amazing Add-ons for Atlassian JIRA and ConfluenceBuild Amazing Add-ons for Atlassian JIRA and Confluence
Build Amazing Add-ons for Atlassian JIRA and Confluence
 
Java springboot microservice - Accenture Technology Meetup
Java springboot microservice - Accenture Technology MeetupJava springboot microservice - Accenture Technology Meetup
Java springboot microservice - Accenture Technology Meetup
 
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
 
Dropwizard Internals
Dropwizard InternalsDropwizard Internals
Dropwizard Internals
 
REST APIs with Spring
REST APIs with SpringREST APIs with Spring
REST APIs with Spring
 
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
 
Next stop: Spring 4
Next stop: Spring 4Next stop: Spring 4
Next stop: Spring 4
 
RESTful web apps with Apache Sling - 2013 version
RESTful web apps with Apache Sling - 2013 versionRESTful web apps with Apache Sling - 2013 version
RESTful web apps with Apache Sling - 2013 version
 
Iac d.damyanov 4.pptx
Iac d.damyanov 4.pptxIac d.damyanov 4.pptx
Iac d.damyanov 4.pptx
 
Automating Your Microsoft Azure Environment (DevLink 2014)
Automating Your Microsoft Azure Environment (DevLink 2014)Automating Your Microsoft Azure Environment (DevLink 2014)
Automating Your Microsoft Azure Environment (DevLink 2014)
 
Build Your Own CMS with Apache Sling
Build Your Own CMS with Apache SlingBuild Your Own CMS with Apache Sling
Build Your Own CMS with Apache Sling
 

Destaque

Extending Spring for Custom Usage
Extending Spring for Custom UsageExtending Spring for Custom Usage
Extending Spring for Custom UsageJoshua Long
 
Enterprise Integration and Batch Processing on Cloud Foundry
Enterprise Integration and Batch Processing on Cloud FoundryEnterprise Integration and Batch Processing on Cloud Foundry
Enterprise Integration and Batch Processing on Cloud FoundryJoshua Long
 
Spring Batch Behind the Scenes
Spring Batch Behind the ScenesSpring Batch Behind the Scenes
Spring Batch Behind the ScenesJoshua Long
 
Spring Integration and EIP Introduction
Spring Integration and EIP IntroductionSpring Integration and EIP Introduction
Spring Integration and EIP IntroductionIwein Fuld
 
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
 
Spring integration概要
Spring integration概要Spring integration概要
Spring integration概要kuroiwa
 
Pattern driven Enterprise Architecture
Pattern driven Enterprise ArchitecturePattern driven Enterprise Architecture
Pattern driven Enterprise ArchitectureWSO2
 
Spring integration을 통해_살펴본_메시징_세계
Spring integration을 통해_살펴본_메시징_세계Spring integration을 통해_살펴본_메시징_세계
Spring integration을 통해_살펴본_메시징_세계Wangeun Lee
 
Economies of Scaling Software
Economies of Scaling SoftwareEconomies of Scaling Software
Economies of Scaling SoftwareJoshua Long
 
기업 통합 패턴(Enterprise Integration Patterns) 강의
기업 통합 패턴(Enterprise Integration Patterns) 강의기업 통합 패턴(Enterprise Integration Patterns) 강의
기업 통합 패턴(Enterprise Integration Patterns) 강의정호 차
 

Destaque (10)

Extending Spring for Custom Usage
Extending Spring for Custom UsageExtending Spring for Custom Usage
Extending Spring for Custom Usage
 
Enterprise Integration and Batch Processing on Cloud Foundry
Enterprise Integration and Batch Processing on Cloud FoundryEnterprise Integration and Batch Processing on Cloud Foundry
Enterprise Integration and Batch Processing on Cloud Foundry
 
Spring Batch Behind the Scenes
Spring Batch Behind the ScenesSpring Batch Behind the Scenes
Spring Batch Behind the Scenes
 
Spring Integration and EIP Introduction
Spring Integration and EIP IntroductionSpring Integration and EIP Introduction
Spring Integration and EIP Introduction
 
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
 
Spring integration概要
Spring integration概要Spring integration概要
Spring integration概要
 
Pattern driven Enterprise Architecture
Pattern driven Enterprise ArchitecturePattern driven Enterprise Architecture
Pattern driven Enterprise Architecture
 
Spring integration을 통해_살펴본_메시징_세계
Spring integration을 통해_살펴본_메시징_세계Spring integration을 통해_살펴본_메시징_세계
Spring integration을 통해_살펴본_메시징_세계
 
Economies of Scaling Software
Economies of Scaling SoftwareEconomies of Scaling Software
Economies of Scaling Software
 
기업 통합 패턴(Enterprise Integration Patterns) 강의
기업 통합 패턴(Enterprise Integration Patterns) 강의기업 통합 패턴(Enterprise Integration Patterns) 강의
기업 통합 패턴(Enterprise Integration Patterns) 강의
 

Semelhante a 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
 
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
 
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
 
Spring5 New Features
Spring5 New FeaturesSpring5 New Features
Spring5 New FeaturesJay Lee
 
Introduction tomcat7 servlet3
Introduction tomcat7 servlet3Introduction tomcat7 servlet3
Introduction tomcat7 servlet3JavaEE Trainers
 
Staying Sane with Drupal NEPHP
Staying Sane with Drupal NEPHPStaying Sane with Drupal NEPHP
Staying Sane with Drupal NEPHPOscar Merida
 
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
 
The Meteor Framework
The Meteor FrameworkThe Meteor Framework
The Meteor FrameworkDamien Magoni
 
Spring design-juergen-qcon
Spring design-juergen-qconSpring design-juergen-qcon
Spring design-juergen-qconYiwei Ma
 

Semelhante a 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 ...
 
Java EE 8
Java EE 8Java EE 8
Java EE 8
 
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
 
REST easy with API Platform
REST easy with API PlatformREST easy with API Platform
REST easy with API Platform
 
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?
 
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
 
Spring5 New Features
Spring5 New FeaturesSpring5 New Features
Spring5 New Features
 
JSF2
JSF2JSF2
JSF2
 
Introduction tomcat7 servlet3
Introduction tomcat7 servlet3Introduction tomcat7 servlet3
Introduction tomcat7 servlet3
 
Staying Sane with Drupal NEPHP
Staying Sane with Drupal NEPHPStaying Sane with Drupal NEPHP
Staying Sane with Drupal NEPHP
 
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?
 
The Meteor Framework
The Meteor FrameworkThe Meteor Framework
The Meteor Framework
 
Spring design-juergen-qcon
Spring design-juergen-qconSpring design-juergen-qcon
Spring design-juergen-qcon
 

Mais de 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
 
Spring Batch Performance Tuning
Spring Batch Performance TuningSpring Batch Performance Tuning
Spring Batch Performance TuningGunnar Hillert
 
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
 
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
 
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
 

Mais de Gunnar Hillert (10)

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
 
Spring Batch Performance Tuning
Spring Batch Performance TuningSpring Batch Performance Tuning
Spring Batch Performance Tuning
 
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
 
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
 
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
 

Último

How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWERMadyBayot
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfOverkill Security
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Victor Rentea
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Victor Rentea
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Zilliz
 
Cyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfCyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfOverkill Security
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDropbox
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKJago de Vreede
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024The Digital Insurer
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...apidays
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024The Digital Insurer
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistandanishmna97
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native ApplicationsWSO2
 

Último (20)

How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Cyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfCyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdf
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 

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 ElasticSearch Cassandra Couchbase Neo4j
  • 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