Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software, Inc. and licensed under a
Creative Commons Attribution-NonCommercial l icense: http://creativecommons.org/licenses/by-nc/3.0/
Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software, Inc. and licensed under a
Creative Commons Attribution-NonCommercial l icense: http://creativecommons.org/licenses/by-nc/3.0/
Day 1 Keynote: Platform Reinvented
Hugh Williams, Juergen Hoeller, Dave Syer, Andy Glover, Graeme Rocher
Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software, Inc. and licensed under a
Creative Commons Attribution-NonCommercial l icense: http://creativecommons.org/licenses/by-nc/3.0/
Spring IO Platform Reprise
2
Jobs, Steps,
Readers, Writers
Ingestion, Export,
Orchestration, Hadoop
Controllers, REST,
WebSocket
Channels, Adapters,
Filters, Transformers
WEB INTEGRATION BATCH BIG DATA
SPRING CORE
FRAMEWORK SECURITY GROOVY REACTOR
DATA
RELATIONAL
DATA ACCESS
NON-RELATIONAL
DATA ACCESS
BOOT
Bootable, Minimal, Ops-Ready
GRAILS Full-stack,
Web
XD Stream, Taps,
Jobs
IO EXECUTION
IO FOUNDATION
Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software, Inc. and licensed under a
Creative Commons Attribution-NonCommercial l icense: http://creativecommons.org/licenses/by-nc/3.0/
Spring IO Platform
3
Grails
Spring IO Platform Distribution
Spring XD
Spring Foundation
Apps
3rd Party Dependencies
Spring Boot
Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software, Inc. and licensed under a
Creative Commons Attribution-NonCommercial l icense: http://creativecommons.org/licenses/by-nc/3.0/
Spring IO Platform Distribution Roadmap
4
2.0 1.0 1.1
June 2014
Spring 4.0 baseline
Nov 2014
Spring 4.1 baseline
1H 2015
12 months - major
Current: 1.0.2
6 months - minor
Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software, Inc. and licensed under a
Creative Commons Attribution-NonCommercial l icense: http://creativecommons.org/licenses/by-nc/3.0/
Spring IO Execution: Spring Boot
• Execution layer: eliminate boilerplate
configuration
• Spring Boot 1.1.x Released
• 88 contributors
• Foundation for all Spring IO Execution
Layer DSRs
5
Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software, Inc. and licensed under a
Creative Commons Attribution-NonCommercial l icense: http://creativecommons.org/licenses/by-nc/3.0/
Spring IO Execution: Spring Boot
6
@RestController
class App {
@RequestMapping('/')
def home() {
"""
<html><body>Message: 'Hello World!’</body></html>
"""
}
}
Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software, Inc. and licensed under a
Creative Commons Attribution-NonCommercial l icense: http://creativecommons.org/licenses/by-nc/3.0/
Demo:
Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software, Inc. and licensed under a
Creative Commons Attribution-NonCommercial l icense: http://creativecommons.org/licenses/by-nc/3.0/
Spring Boot
7
Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software, Inc. and licensed under a
Creative Commons Attribution-NonCommercial l icense: http://creativecommons.org/licenses/by-nc/3.0/
Spring Boot Sessions
8
TUE 8:30 AM Inside spring.io: a Production Spring Reference Application
TUE 10:30 AM Booting up Spring Social
TUE 2:30 PM Spring Boot for the Web Tier
TUE 4:30 PM Making Spring Boot Even Groovier
WED 10:30 AM "Bootiful" Applications with Spring Boot
THU 8:30 AM Micro Service Architecture with Spring Boot and Groovy
WED 12:45 PM Panel: Real World Boot-up Sequences
Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software, Inc. and licensed under a
Creative Commons Attribution-NonCommercial l icense: http://creativecommons.org/licenses/by-nc/3.0/ 9
Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software, Inc. and licensed under a
Creative Commons Attribution-NonCommercial l icense: http://creativecommons.org/licenses/by-nc/3.0/
Ten Years
Ago!
Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software, Inc. and licensed under a
Creative Commons Attribution-NonCommercial l icense: http://creativecommons.org/licenses/by-nc/3.0/
Competitive Advantage
Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software, Inc. and licensed under a
Creative Commons Attribution-NonCommercial l icense: http://creativecommons.org/licenses/by-nc/3.0/
Velocity is the Killer App
Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software, Inc. and licensed under a
Creative Commons Attribution-NonCommercial l icense: http://creativecommons.org/licenses/by-nc/3.0/
Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software, Inc. and licensed under a
Creative Commons Attribution-NonCommercial l icense: http://creativecommons.org/licenses/by-nc/3.0/
Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software, Inc. and licensed under a
Creative Commons Attribution-NonCommercial l icense: http://creativecommons.org/licenses/by-nc/3.0/
Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software, Inc. and licensed under a
Creative Commons Attribution-NonCommercial l icense: http://creativecommons.org/licenses/by-nc/3.0/
Velocity
on the JVM
is the Killer App
Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software, Inc. and licensed under a
Creative Commons Attribution-NonCommercial l icense: http://creativecommons.org/licenses/by-nc/3.0/
Spring IO and Microservices
• “Microservices” are not a free lunch
• Fortunately, many common problems have boilerplate solutions
• Spring is all about removing boilerplate:
• Foundation: business logic (Spring Framework, Spring Data, Reactor, etc.)
• Execution: configuration and runtime (Spring Boot, Spring XD, Grails)
• Coordination: patterns in distributed systems (Spring Cloud Components)
Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software, Inc. and licensed under a
Creative Commons Attribution-NonCommercial l icense: http://creativecommons.org/licenses/by-nc/3.0/
Spring IO Platform
18
Grails
Spring IO Platform Distribution
Spring XD
Spring Foundation
Apps
3rd Party Dependencies
Spring Boot
Spring Cloud
Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software, Inc. and licensed under a
Creative Commons Attribution-NonCommercial l icense: http://creativecommons.org/licenses/by-nc/3.0/
Spring IO Platform: Coordination
19
Jobs, Steps,
Readers, Writers
Ingestion, Export,
Orchestration, Hadoop
Controllers, REST,
WebSocket
Channels, Adapters,
Filters, Transformers
WEB INTEGRATION BATCH BIG DATA
SPRING CORE
FRAMEWORK SECURITY GROOVY REACTOR
DATA
RELATIONAL
DATA ACCESS
NON-RELATIONAL
DATA ACCESS
BOOT
Bootable, Minimal, Ops-Ready
GRAILS Full-stack,
Web
XD Stream, Taps,
Jobs
IO EXECUTION
IO FOUNDATION
IO COORDINATION SPRING CLOUD
Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software, Inc. and licensed under a
Creative Commons Attribution-NonCommercial l icense: http://creativecommons.org/licenses/by-nc/3.0/
Spring IO Core: Groovy Update
• What’s new in Groovy 2.3
• Java 8 support
• Traits
• Templating
• What’s coming in Groovy 2.4
• Android support
• New documentation
• New website
20
Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software, Inc. and licensed under a
Creative Commons Attribution-NonCommercial l icense: http://creativecommons.org/licenses/by-nc/3.0/
Groovy 2.3 : Java 8 support
• Supports Java 8 runtime (not syntax)
• Use closures where you would use Java 8 lambdas
21
Java 8 Groovy
Integer youngest = persons.stream()
.filter(p -> p.getAge() > 18)
.map(Person::getAge)
.min(Comparator.<Integer>naturalOrder())
.get()
def youngest = persons.stream()
.filter { it.age > 18 }
.map { it.age }
.min { a,b -> a<=>b }
.get()
Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software, Inc. and licensed under a
Creative Commons Attribution-NonCommercial l icense: http://creativecommons.org/licenses/by-nc/3.0/
Groovy 2.3: Traits
• Composition of behaviors
with traits
• Favors composition over
inheritance
• Compatible with
@CompileStatic
• Callable from Java
22
trait Flying {
void fly() { println "I'm flying!" }
}
trait Speaking {
void speak() { println "I'm speaking!" }
}
class SpeakingDuck implements Flying,
Speaking {
void quack() { println "I'm quacking!" }
void speak() { prinln quack() }
}
def duck = new SpeakingDuck()
duck.fly()
duck.quack()
Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software, Inc. and licensed under a
Creative Commons Attribution-NonCommercial l icense: http://creativecommons.org/licenses/by-nc/3.0/
Groovy 2.3: New Template Engine
• MarkupTemplateEngine
• Primarily aimed at XML-like contents
• Builder syntax, Layouts and Type Checking
• Supported in Spring 4.1 and Spring Boot
23
@Controller @RequestMapping("/person") class PersonController { @RequestMapping("list") def list() { new ModelAndView( 'views/person/list', [persons: Person.list()] ) }}
ul { persons.each { person -> li { a(href: "/person/$person.id", "$person.lastName $person.firstName") } } }
Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software, Inc. and licensed under a
Creative Commons Attribution-NonCommercial l icense: http://creativecommons.org/licenses/by-nc/3.0/
Groovy 2.4 : Android Support
• Develop a full Android application in Groovy
• Gradle plugin
24
Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software, Inc. and licensed under a
Creative Commons Attribution-NonCommercial l icense: http://creativecommons.org/licenses/by-nc/3.0/
Groovy Housekeeping
• Shiny new website
• Statically generated
• New documentation
25
POWERED BY ASCIIDOCTOR
Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software, Inc. and licensed under a
Creative Commons Attribution-NonCommercial l icense: http://creativecommons.org/licenses/by-nc/3.0/
Spring IO Execution: Grails Update
• Grails 2.4
• Current release 2.4.3
• Ongoing maintenance
• 1150 Plugins!
• What’s coming in Grails 3.0
• Complete rewrite
26
Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software, Inc. and licensed under a
Creative Commons Attribution-NonCommercial l icense: http://creativecommons.org/licenses/by-nc/3.0/
Spring IO Execution: Grails 3.0 on Boot
• Grails 3.0 built on Spring Boot
• Spring IO Execution Layer
• Full support for Micro Services
• Traditional, Fat JAR and
embedded deployment
• Native Gradle and Maven support
• Ground up rewrite
27
Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software, Inc. and licensed under a
Creative Commons Attribution-NonCommercial l icense: http://creativecommons.org/licenses/by-nc/3.0/
Spring IO Execution: Grails 3.0 Goals
• Plugin Model / Event Driven
• Multi Project Builds
• Microservices
• App Profiles: Netty, Servlet, Batch etc.
• Remove Bloat
• Reduce Dependencies
• Allow scaling from micro to modular monolith
28
Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software, Inc. and licensed under a
Creative Commons Attribution-NonCommercial l icense: http://creativecommons.org/licenses/by-nc/3.0/
Spring IO Execution: Grails 3.0 Plugins
29
Gra
ils.s
h
Sta
tic v
oid
ma
in
Gra
dle
Bu
ild
Forked Grails Runtime
test-app
shell run-app
console
Codegen
Plugins Build Time
Plugins
Runtime
Plugins
Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software, Inc. and licensed under a
Creative Commons Attribution-NonCommercial l icense: http://creativecommons.org/licenses/by-nc/3.0/
Spring IO Execution: Grails Microservices
30
@Grab("com.h2database:h2:1.3.173")
import grails.persistence.*
@Entity
@Resource(uri='/books')
class Book {
String title
}
Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software, Inc. and licensed under a
Creative Commons Attribution-NonCommercial l icense: http://creativecommons.org/licenses/by-nc/3.0/
Demo:
Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software, Inc. and licensed under a
Creative Commons Attribution-NonCommercial l icense: http://creativecommons.org/licenses/by-nc/3.0/
Grails 3.0
31
Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software, Inc. and licensed under a
Creative Commons Attribution-NonCommercial l icense: http://creativecommons.org/licenses/by-nc/3.0/
Groovy and Grails Sessions
32
TUE 8:30 AM Groovy in 2014 and beyond
TUE 10:30 AM Grails 3.0 Preview
TUE 12:45 PM Groovy, in the light of Java 8
TUE 2:30 PM Rethinking API Design with Traits
WED 8:30 AM Microservices Architecture with Grails
WED 2:30 PM Ratpack & Grails 3.0
Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software, Inc. and licensed under a
Creative Commons Attribution-NonCommercial l icense: http://creativecommons.org/licenses/by-nc/3.0/
Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software, Inc. and licensed under a
Creative Commons Attribution-NonCommercial l icense: http://creativecommons.org/licenses/by-nc/3.0/
Day 2 Keynote: Platform Reinvented
Juergen Hoeller, Mark Fisher, Dave Syer, Jon Brisbin
33
Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software, Inc. and licensed under a
Creative Commons Attribution-NonCommercial l icense: http://creativecommons.org/licenses/by-nc/3.0/
Spring IO Platform
34
Jobs, Steps,
Readers, Writers
Ingestion, Export,
Orchestration, Hadoop
Controllers, REST,
WebSocket
Channels, Adapters,
Filters, Transformers
WEB INTEGRATION BATCH BIG DATA
SPRING CORE
FRAMEWORK SECURITY GROOVY REACTOR
DATA
RELATIONAL
DATA ACCESS
NON-RELATIONAL
DATA ACCESS
BOOT
Bootable, Minimal, Ops-Ready
GRAILS Full-stack,
Web
XD Stream, Taps,
Jobs
IO EXECUTION
IO FOUNDATION
IO COORDINATION SPRING CLOUD
Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software, Inc. and licensed under a
Creative Commons Attribution-NonCommercial l icense: http://creativecommons.org/licenses/by-nc/3.0/
Spring IO Core: Spring Framework 4.1 GA
• Annotated JMS listener methods
• Comprehensive support for JCache (JSR-107) annotations
• Flexible resolution and transformation of static web resources
• MVC views: declarative resolution + Groovy markup templates
• Performance: SpEL compiler mode + concurrency fine-tuning
35
Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software, Inc. and licensed under a
Creative Commons Attribution-NonCommercial l icense: http://creativecommons.org/licenses/by-nc/3.0/
Spring 4.1: Annotated JMS listener methods
36
@Component
public class MyService {
@JmsListener(destination = "myQueue")
public void processOrder(Order order, @Header("order_type") String type) {
...
}
}
Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software, Inc. and licensed under a
Creative Commons Attribution-NonCommercial l icense: http://creativecommons.org/licenses/by-nc/3.0/
Spring 4.1: Support for JCache annotations
37
@Component
public class MyService {
@CacheResult(cacheName = "book")
public Book findBook(@CacheKey ISBN isbn, boolean checkWarehouse) {
...
}
}
Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software, Inc. and licensed under a
Creative Commons Attribution-NonCommercial l icense: http://creativecommons.org/licenses/by-nc/3.0/
Spring 4.1: Flexible web resource handling
• Flexible resource resolution chain:path resolution, caching,
compression, versioning
• Flexible resource transformation chain:CSS links, caching,
HTML5 AppCache manifests
• Talk: “Resource Handling in Spring MVC 4.1”
by Brian Clozel and Rossen Stoyanchev - Wednesday 8:30
• Showcase: https://github.com/bclozel/spring-resource-handling
38
Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software, Inc. and licensed under a
Creative Commons Attribution-NonCommercial l icense: http://creativecommons.org/licenses/by-nc/3.0/
Spring 4.1: Declarative MVC view resolution
39
@Configuration
@EnableWebMvc
public class WebConfig extends WebMvcConfigurerAdapter {
public void configureViewResolvers(ViewResolverRegistry registry) {
registry.enableContentNegotiation(new MappingJackson2JsonView());
registry.freeMarker().cache(false);
}
}
Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software, Inc. and licensed under a
Creative Commons Attribution-NonCommercial l icense: http://creativecommons.org/licenses/by-nc/3.0/
Spring 4.1: Many further improvements...
• Java 8's Optional for injection points and MVC handler
parameters
• Annotated @Lookup methods with support for method arguments
• Direct field binding support with auto-growing for nested fields
• WebSocket scope, SockJS client support, WebSocket stats
• Declarative SQL scripts and programmatic transactions for tests
40
Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software, Inc. and licensed under a
Creative Commons Attribution-NonCommercial l icense: http://creativecommons.org/licenses/by-nc/3.0/
Spring XD – Big Data, Little Time
41
Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software, Inc. and licensed under a
Creative Commons Attribution-NonCommercial l icense: http://creativecommons.org/licenses/by-nc/3.0/
Spring XD: Unified Platform for Big Data
42
Spring XD Runtime
BIDIRECTIONAL
Compute
HDFS
RDBMS
NoSQL
R, SAS
Streams Jobs
ingest workflow
export
taps
Predictive Modelling
>_
Redis
Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software, Inc. and licensed under a
Creative Commons Attribution-NonCommercial l icense: http://creativecommons.org/licenses/by-nc/3.0/
Spring XD: Quality of Service
• High Availability
• Cluster Management built upon ZooKeeper
• Leader Election for Admin Nodes
• Module Redeployment across Container Nodes
• Customizable Deployment
• Module Count and Criteria Properties
• Data Partitioning by Key (with SpEL support)
• Direct Binding for Co-located Modules (reduce network IO)
43
Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software, Inc. and licensed under a
Creative Commons Attribution-NonCommercial l icense: http://creativecommons.org/licenses/by-nc/3.0/
Demo Domain: Smart Grid Data
44
http://www.cse.iitb.ac.in/debs2014 *
Inspired by ACM DEBS 2014 Grand Challenge* Demonstrate the applicability of event-based systems to provide scalable, real-time analytics over high volume sensor data to compute load forecasting.
Field Name Description
ID Unique ID of the measurement
Timestamp Number of seconds since epoch
Load Load in watts
House ID The house where the plug is located
Household ID The household inside the house
Plug ID The unique ID of the smart plug
Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software, Inc. and licensed under a
Creative Commons Attribution-NonCommercial l icense: http://creativecommons.org/licenses/by-nc/3.0/
Demo Domain: Smart Grid Data
45
Field Name Description
ID Unique ID of the measurement
Timestamp Number of seconds since epoch
Load Load in watts
House ID The house where the plug is located
Household ID The household inside the house
Plug ID The unique ID of the smart plug
Inspired by ACM DEBS 2014 Grand Challenge* Demonstrate the applicability of event-based systems to provide scalable, real-time analytics over high volume sensor data to compute load forecasting.
Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software, Inc. and licensed under a
Creative Commons Attribution-NonCommercial l icense: http://creativecommons.org/licenses/by-nc/3.0/
Demo Objectives
• Predictive models for energy consumption demand
• generated via R and exported as PMML
• Ingesting household meter data to HDFS via HTTP
• partitioning based on House ID
• Real-time data filtering and enrichment
• Real-time model scoring
• performed via Spring XD’s analytics-pmml processor module
• Real-time computed data aggregation
• Asynchronous UI updates
46
Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software, Inc. and licensed under a
Creative Commons Attribution-NonCommercial l icense: http://creativecommons.org/licenses/by-nc/3.0/
Demo Topology
47
XD Admin
Zoo Keeper Zoo Keeper Zoo Keeper
Load
Balancer Generator
XD Container
HTTP
XD Container
HTTP
XD Container
HDFS
XD Container
HDFS
XD Container
HDFS Redis
Rabbit MQ
Hadoop
Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software, Inc. and licensed under a
Creative Commons Attribution-NonCommercial l icense: http://creativecommons.org/licenses/by-nc/3.0/
Demo:
Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software, Inc. and licensed under a
Creative Commons Attribution-NonCommercial l icense: http://creativecommons.org/licenses/by-nc/3.0/
Spring XD
48
Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software, Inc. and licensed under a
Creative Commons Attribution-NonCommercial l icense: http://creativecommons.org/licenses/by-nc/3.0/
Looking Ahead
• Programming Model • Further Unification of the Batch and Stream Models
• Reactive Streams Support
• Developer Experience • Support for Java Config and Spring Integration DSLs
• Spring Boot-based Module Deployment and Packaging
• Deployment Targets • Spring XD as a PCF service
• Spring XD on Docker
• Spring XD on Mesos
• Quality of Service • Batching and Compression via Message Bus Interceptors
• Comprehensive Security Model
49
Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software, Inc. and licensed under a
Creative Commons Attribution-NonCommercial l icense: http://creativecommons.org/licenses/by-nc/3.0/
Spring XD Sessions
50
TUE 2:30 PM Develop powerful Big Data Applications easily with Spring XD
TUE 4:30 PM Spring XD - A Guided Tour
WED 10:30 AM Building a Recommendation Engine with Spring and Hadoop
WED 2:30 PM IoT Realized - The Connected Car
THU 10:30 AM Spring XD for Real-time Hadoop Workload Analysis
THU 12:45 PM Implementing the Lambda Architecture with Spring XD
Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software, Inc. and licensed under a
Creative Commons Attribution-NonCommercial l icense: http://creativecommons.org/licenses/by-nc/3.0/
Spring IO Platform
51
Grails
Spring IO Platform
Spring XD
Spring Foundation
Apps
Spring Cloud
3rd Party Dependencies
Spring Boot
Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software, Inc. and licensed under a
Creative Commons Attribution-NonCommercial l icense: http://creativecommons.org/licenses/by-nc/3.0/
No Man (Microservice) is an Island
It's excellent to be able to implement a microservice really easily
(Spring Boot), but building a system that way surfaces
"non-functional" requirements that you otherwise didn't have.
There are laws of physics that make some problems unsolvable
(consistency, latency), but brittleness and manageability can be
addressed with generic, boiler plate patterns.
52
Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software, Inc. and licensed under a
Creative Commons Attribution-NonCommercial l icense: http://creativecommons.org/licenses/by-nc/3.0/
Emergent features of micro-service systems
Coordination of distributed systems leads to boiler plate patterns
• Distributed/versioned configuration
• Service registration and discovery
• Routing
• Service-to-service calls
• Load balancing
• Circuit Breaker
• Asynchronous
• Distributed messaging
53
Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software, Inc. and licensed under a
Creative Commons Attribution-NonCommercial l icense: http://creativecommons.org/licenses/by-nc/3.0/
Spring Cloud Components
54
Client Bindings
Service
Discovery
Config
Server
Circuit
Breakers
Edge
Service
Intelligent
Router
Leader
Election
One-time
Tokens
Global
Locks
Cluster
State
Event Bus
Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software, Inc. and licensed under a
Creative Commons Attribution-NonCommercial l icense: http://creativecommons.org/licenses/by-nc/3.0/
Demo:
Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software, Inc. and licensed under a
Creative Commons Attribution-NonCommercial l icense: http://creativecommons.org/licenses/by-nc/3.0/
Spring Cloud
Components
55
Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software, Inc. and licensed under a
Creative Commons Attribution-NonCommercial l icense: http://creativecommons.org/licenses/by-nc/3.0/
Spring Cloud Components
• Common features of distributed systems developed by users as
Spring Boot apps
• Highly configurable and customizable
• Always do something sensible out of the box
• Works nicely as standalone apps on developer box
• Easy migration to Cloud and PCF
56
Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software, Inc. and licensed under a
Creative Commons Attribution-NonCommercial l icense: http://creativecommons.org/licenses/by-nc/3.0/
Spring Cloud Sessions
57
TUE 4:30 PM Security for Microservices with Spring and OAuth2
WED 12:45 PM Simplify Cloud Applications using Spring Cloud
WED 12:45 PM Spring Cloud, Spring Boot and Netflix OSS
WED 2:30 PM Developing Microservices for PaaS with Spring and Cloud Foundry
Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software, Inc. and licensed under a
Creative Commons Attribution-NonCommercial l icense: http://creativecommons.org/licenses/by-nc/3.0/
Demo:
Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software, Inc. and licensed under a
Creative Commons Attribution-NonCommercial l icense: http://creativecommons.org/licenses/by-nc/3.0/
Reactor
58
Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software, Inc. and licensed under a
Creative Commons Attribution-NonCommercial l icense: http://creativecommons.org/licenses/by-nc/3.0/
Spring IO Core: Reactor
• Microservices proliferate in modern architectures
• No Microservice is an Island
• More Microservices === More Runtime Resources required
• More More Runtime Resources required === More $$$
• Microservices have acute need for efficiency
• Contrary to myth: Runtime Resources aren’t free/cheap
• Microservices are natural fit for Reactive Architecture
59
Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software, Inc. and licensed under a
Creative Commons Attribution-NonCommercial l icense: http://creativecommons.org/licenses/by-nc/3.0/
Spring IO Core: Reactor
• What is Reactive Programming?
• Event-driven
• Modular
• Scalable
• Highly-available
• Non-blocking/async
o Blocking IO (BIO) is expensive
o Non-blocking IO (NIO) is more efficient
o NIO means async patterns, which can be hard
60
Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software, Inc. and licensed under a
Creative Commons Attribution-NonCommercial l icense: http://creativecommons.org/licenses/by-nc/3.0/ 61
Reactive Architecture
• Reactive is usually Asynchronous
• Asynchronous !== Concurrent
• Non-blocking versus Blocking (usually IO)
• Provides Isolation
• Resource usage
• Failure
• Events are replayable
• Reactive can be complex
• Too low-level for most end users
Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software, Inc. and licensed under a
Creative Commons Attribution-NonCommercial l icense: http://creativecommons.org/licenses/by-nc/3.0/
Reactor
Spring IO: Components → Reactor
62
Task Queue
Micro
Service
Micro
Service
Micro
Service
Micro
Service
Event
Event Event
Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software, Inc. and licensed under a
Creative Commons Attribution-NonCommercial l icense: http://creativecommons.org/licenses/by-nc/3.0/
Reactive Stream Contributors
63
ccv
Doug Lea – SUNY Oswego
Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software, Inc. and licensed under a
Creative Commons Attribution-NonCommercial l icense: http://creativecommons.org/licenses/by-nc/3.0/
Spring IO Core: Reactor
What is Reactive Streams?
64
“...provide a standard for asynchronous stream processing with
non-blocking backpressure.”
github.com/reactive-streams/reactive-streams
Available as a library
org.reactivestreams:reactive-streams:0.4.0.M2
Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software, Inc. and licensed under a
Creative Commons Attribution-NonCommercial l icense: http://creativecommons.org/licenses/by-nc/3.0/
Spring IO Core: Reactor
• Reactive Streams API
• Publisher
• Subscriber
• Subscription
• Reactor’s Stream API implements Reactive Streams standard
65
Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software, Inc. and licensed under a
Creative Commons Attribution-NonCommercial l icense: http://creativecommons.org/licenses/by-nc/3.0/ 66
R: 64
G: 173
B: 100
R: 77
G: 172
B: 169
R: 85 G: 139 B: 49
R: 63
G: 129
B: 179
R: 238
G: 238
B: 238
R: 51 G: 51 B: 51
R: 255 G: 255 B: 255
R: 84
G: 108
B: 159
R: 218
G: 102
B: 102
R: 226
G: 161
B: 47
R: 143
G: 136
B: 73
R: 125
G: 78
B: 128
Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software, Inc. and licensed under a
Creative Commons Attribution-NonCommercial l icense: http://creativecommons.org/licenses/by-nc/3.0/
Code formatting notes
67
Minimum 16pt
Blue 0 | 0 | 192
Purple 127 | 0 | 85
Orange 241 | 154 | 39
Green (notes) 63 | 127 | 95
Grey (annotations)