SlideShare a Scribd company logo
1 of 75
Download to read offline
REACTOR AND THE REACTIVE STREAMS 
STANDARD 
Jon Brisbin - Stephane Maldini 
© 2014 SpringOne 2GX. All rights reserved. Do not distribute without permission. 
including plenty of lol™
‘Bout the guys speaking 
2 
! 
@j_brisbin - 100% asynchronous poet 
Reactor Committer I 
Reactive-Streams Contributor 
! 
@smaldini - solve 9 issues, create 10 problems 
Reactor Committer II 
Reactive-Streams Contributor
Session Manifesto 
• Tweet questions during the presentation 
–@ProjectReactor 
! 
• 90 minutes is long, plenty of time to fall asleep and awake in a 
storm of nonsense 
• Come chat with us after the session 
• Jump/Sleep to the last slide to find our coordinates 
3
4
Aperture Sciences Test 981: 
Observe the following examples 
5 
NanoService, MicroService, NotTooBigService™…
NanoService, MicroService, NotTooBigService™… 
6 
cat file.csv | grep ‘doge’ | sort
NanoService, MicroService, NotTooBigService™… 
7 
POST [json] http://dogecoin.money/send/id 
—> GET [json] http://dogeprofile.money/id 
—> POST [json] http://nsa.gov.us/cc/trace/id
NanoService, MicroService, NotTooBigService™… 
8 
userService.auth(username,password) 
—> userService.hashPassword(password) 
—> userService.findByNameAndHash(name)
NanoService, MicroService, NotTooBigService™… 
9 
• A SomethingService will always need to interact 
• With the user 
• With other services 
! 
• The boundary between services is the real deal 
• A big danger lurks in the dark 
• More breakdown => More boundaries 
=> Danger Will Robinson
10 
And this threat has a name 
Latency
11 
UberFact : Humans don’t really enjoy waiting 
Neither do The Machines
What is latency doing to you ? 
12 
• Loss of revenues 
• because users switched to another site/app 
• because services are compounding inefficiency 
• because aggressive scaling will be needed 
• because dev budget will sink into addressing this a postiori 
‘2 bucks prediction’ : tech team turnover will increase and keep 
mourning about how crap is their design
13 
Loading
All hail Reactive Programming 
• A possible answer to this issue 
• The very nature of Reactor, look at the name dude 
• A fancy buzz-word that might work better than MDA or SOA 
• A simple accumulation of years of engineering 
14
No sh*t, what is Reactive Programming ? 
15 
Event-Driven Fault-Tolerant 
Low-latency* 
Scalable
Reactive Architecture ? 
• A Reactive system MUST be resilient 
–splitting concerns to achieve error bulk-heading and 
modularity 
! 
• A Reactive system MUST be scalable 
– scale-up : partition work across CPUs 
– scale-out : distribute over peer nodes 
16
Reactive Architecture ! 
• Asynchronous Programming is core to Reactive Architecture 
• Immediate answer to the originating publisher 
• Context segregation to avoid cascade failure as possible 
! 
• Functional Programming fits perfectly as it is stimulus based 
• Related: Functional Reactive Programming 
17
18 
Reactor has 99 problems but Latency isn’t one
Reactor-Core features 
19 
[A]synchronous Dispatchers 
Event Bus [Reactor.class] 
Streams and Promises 
Functional artifacts 
(SAM components, tuples, timers) 
Fast IO 
[buffer, net, 
persistent queues, 
codec] 
Fast Data 
[allocators, batch-processors]
Dispatching model matters 
• Context switching hurts performances 
• Locking hurts performances 
• Message passing hurts performances 
• Blocking for a thread hurts performances 
• Resources cost 
20
Built-in UberFast™ dispatcher 
• LMAX Disruptor deals with message passing issues 
• Based on a Ring Buffer structure 
• “Mechanical Sympathy” in Disruptor 
! 
• http://lmax-exchange.github.com/disruptor/files/ 
Disruptor-1.0.pdf 
• http://mechanitis.blogspot.co.uk/2011/06/dissecting-disruptor-whats- 
so-special.html 
21
Message Passing matters 
• Pull vs Push patterns 
– Push: 
•Non blocking programming (e.g. lock-free LMAX RingBuffer) 
•Functional programming 
•Best for in-process short access 
! 
– Pull: 
•Queue based decoupling 
•Best for slow services or blocking connections 
22
Reactor event bus in action In Groovy because Java doesn’t fit into the slide 
23 
import reactor.core.Environment 
import reactor.core.spec.Reactors 
import reactor.event.Event 
import static reactor.event.selector.Selectors.$ 
! 
def env = new Environment() 
def r = Reactors.reactor(env) 
! 
r.on($('welcome')) { name -> 
println "hello $name" 
Manage dispatchers 
Listen for names on Topic ‘welcome’ 
} 
! 
r.notify($('welcome'), Event.wrap('Doge')) 
Reactor builder 
Send an Event to Topic ‘welcome’
Reactor callback hell In Groovy because Java doesn’t fit into the slide 
24 
r.on($('talk')) { Event<String> speak -> 
2nd level callback 
// do stuff with speak 
def topic = $("bye-$speak.headers.name") 
r.notify(topic, Event.wrap("$speak.data, much sad")) 
} 
! 
r.on($('welcome')) { name -> 
r.on($("bye-$name")){ farewell -> 
println "bye bye ! $farewell... $name" 
} 
def event = Event.wrap('so wow') 
event.headers['name'] = name 
r.notify($('talk'), event) 
} 
! 
r.notify($('welcome'), Event.wrap('Doge')) 
1st level callback 
3rd nested dynamic callback
25 
Stream?
26 
Stream
27 
Stream!
28 
Stream!
Solving callback hell 
29 
import reactor.rx.spec.Streams 
! 
def stream = Streams.defer() 
! 
stream.map{ name -> 
Tuple.of(name, 'so wow') 
}.map{ tuple -> 
Tuple.of(tuple.name, "$tuple.t2, much sad") 
}.consume{ tuple -> 
println "bye bye ! $tuple.t2... $tuple.t1" 
} 
! 
stream.broadcastNext('Doge') 
Prepare a simple Stream 
1st step 
2nd step 
Terminal callback 
Send some data into the stream
Using a Stream ? 
30 
Embedded data-processing Event Handling 
Metrics, Statistics Micro-Batching 
Composition Feedback-Loop
Defining a Stream 
• Represents a sequence of data, possibly unbounded 
• Provide for processing API such as filtering and enrichment 
• Not a Collection, not a Storage 
31
Stream VS Event Bus [Reactor] 
32 
• Works great combined (stream distribution) 
• Type-checked flow 
• Publisher/Subscriber tight control 
• No Signal concurrency 
Rule of thumb: 
if nested event composition > 2, switch to Stream
Hot Stream vs Cold Stream 
• An Hot Stream multi-casts real-time signals 
–think Trade, Tick, Mouse Click 
! 
• A Cold Stream uni-casts deferred signals 
–think File, Array, Random 
33
34 
Introducing Reactive Streams Specification !
What is defined by Reactive Streams ? 
35 
Async non-blocking flow-control 
Interoperable protocol 
Async non-blocking data sequence (Threads, Nodes…) 
Minimal resources requirement
Reactive-Streams: Dynamic Message-Passing 
36 
PUBLISHER 
SUBSCRIBER 
Events 
Demand
Now You Know 
• It is not only queue-based pattern: 
– Signaling demand on a slower Publisher == no buffering 
– Signaling demand on a faster Publisher == buffering 
! 
• Data volume is bounded by a Subscriber 
– Scaling dynamically if required 
37
Out Of The Box : Flow Control 
38 
PUBLISHER 
SUBSCRIBER 
Slow 
Fast 
SUBSCRIBER
Reactive Streams: Batch Processing ? 
• Requesting sized demand allows for batch publishing 
optimizations 
– Could be adapted dynamically based on criteria such as network 
bandwidth… 
– A Publisher could decide to apply grouped operations (aggregating, 
batch serializing) 
39
Reactive Streams: What is in the data sequence ? 
• If the Publisher is an Hot Stream 
– Sequence will be defined by when the Subscriber is connected 
! 
• If the Publisher is a Cold Stream 
– Sequence will be similar for every Subscriber regardless of when 
they connected 
40
Reactive Streams: Transformations ? 
• Does not specify any transformation, only essentials components 
to enable this protocol… 
! 
• …But define a staging component Processor : 
– Both A Subscriber AND a Publisher 
41
42 
Hold on a minute buddy, there are already Streams in Java 8 !
All the “Streaming” tech around… Java 8 
• Java 8 introduces java.util.stream.Stream 
– Functional DSL to support transformations and stages 
– Proactive fetching 
– No dynamic message passing 
– Fits nicely with event-driven libraries such as Reactor and RxJava. 
43
All the “Streaming” tech around… Java 8 
44 
Stream<Widget> widgetsStream = widgets.stream(); 
! 
int sum = widgetsStream 
.filter(b -> b.getColor() == RED) 
.mapToInt(b -> b.getWeight()) 
.sum(); 
Pull operation 
Push operations 
Collection to Stream (Cold)
What about RxJava mate ! All those hipsters use it. 
45
All the “Streaming” tech around… RxJava 
• RxJava provides the now famous Reactive Extensions 
– Rich transformations 
– Event-Driven (onNext, onError, onComplete) 
– Flexible scheduling 
– No dynamic demand OoB(possibly unbounded in-flight data) 
46
All the “Streaming” tech around… Java 8 
47 
Observe a Cold Stream 
numbers = Observable.from([1, 2, 3, 4, 5]); 
! 
numbers.map({it * it}).subscribe( 
{ println(it); }, // onNext 
{ println("Error: " + it.getMessage()); }, // onError 
{ println("Sequence complete"); } // onCompleted 
); 
Push operations 
Demand ‘all’ data
Other “Streaming” tech around… 
• Streaming data is all the rage in modern frameworks: 
– Akka, Storm, Reactor, Ratpack, … 
! 
• Semantics compare with Enterprise Integration Patterns: 
– Camel, Spring Integration/XD, … 
– However it would technically take multiple channels to model a 
single Reactive Streams component (filter, transformer…) 
48
49 
Reactive Streams: Joining forces 
ccv 
Doug Lea – SUNY Oswego
Reactive Streams: Joining forces 
50 
Reactor 
Data Driver 
Akka 
Distributed 
System 
RxJava 
Metrics 
Pipeline 
Ratpack HTTP 
server
Reactive Streams: Joining forces 
! 
• Smart solution and pattern to all reactive applications 
! 
• Writing a standard protocol works best when it is used (!) 
! 
• Beyond the JVM, initial discussions for network stack started 
51
Reactive Streams: Joining forces 
• Semantics 
– Single document listing full rules 
– Open enough to allow for various patterns 
! 
• 4 API Interfaces 
– Publisher, Subscriber, Subscription, Processor 
! 
• TCK to verify implementation behavior 
52
Reactive Streams: org.reactivestreams 
53 
public interface Publisher<T> { 
public void subscribe(Subscriber<T> s); 
} 
! 
public interface Subscriber<T> { 
public void onSubscribe(Subscription s); 
public void onNext(T t); 
public void onError(Throwable t); 
public void onComplete(); 
} 
! 
public interface Subscription { 
public void request(int n); 
public void cancel(); 
} 
public interface Processor<T, R> extends Subscriber<T>, Publisher<R> {}
Reactive Streams: Reactor mapping 
54 
Publisher 
reactor.rx.Stream 
Subscriber 
reactor.rx.actions.Action 
Processor 
reactor.rx.Promise
Reactive Streams: Execution Model 
• Publisher creates a capacity-aware container 
– Subscription per Subscriber 
! 
• No concurrent notifications on a same Subscriber 
! 
• Asynchronous or Synchronous 
– must not impact negatively calling code 
55
Reactive Streams: Signals 
56 
onError | (onSubscribe onNext* (onError | onComplete)?)
Reactive Streams: Async Boundaries 
Resource #1 R2 R3 Resource #4 
57 
! 
nioSelectorThreadOrigin map(f) filter(p) consume(toNioSelectorOutput)
Reactive Streams: Async Boundaries 
Resource #1 Resource #4 
58 
! 
nioSelectorThreadOrigin map(f) filter(p) consume(toNioSelectorOutput)
Reactive Streams: Async Boundaries 
Resource #1 Resource #2 
59 
! 
nioSelectorThreadOrigin map(f) filter(p) consume(toNioSelectorOutput)
10 slides and a demo to go :):):) 
60
Reactor : Iterable Cold Stream 
61 
Streams 
.defer(env, 1, 2, 3, 4, 5) 
.subscribe(identityProcessor);
Reactor : Building blackbox processors 
62 
Processor<Integer,Integer> identityProcessor = 
Action.<Integer>passthrough(env.getDispatcher("ringBuffer")) 
.env(env) 
.capacity(bufferSize) 
.map(integer -> integer) 
.distinctUntilChanged() 
.flatMap(integer -> Promises.success(integer)) 
.filter(integer -> integer >= 0) 
.timeout(100) 
.combine();
A Full Slide Just To Talk About flatMap() 
63 
FlatMap Bucket Challenge ! Nominate 3 
friends to explain flatMap()
Another Slide Just To Talk About flatMap() 
64 
flatMap() is nothing more than the functional 
alternative to RPC. Just a way to say “Ok bind 
this incoming data to this sub-flow and listen 
for the result, dude”.
The Last Slide about flatMap() 
65 
stream.flatMap{ name -> 
Streams.defer(name) 
.observe{ println 'so wow' } 
.map{ 'much monad'} 
}.consume{ 
assert it == 'much monad' 
} 
Feed a dynamic Sub-Stream with a name 
Sub-Stream definition 
Sub-Stream result is merged back to the top-level Steam
Reactor does also Scale-Up 
66 
deferred = Streams.defer(environment); 
deferred 
.parallel(8) 
.map(stream -> stream 
.map(i -> i) 
.reduce(2, service::reducePairAsMap) 
.consume(service::forwardToOutput) 
);
67 
DEMO https://github.com/SpringOne2GX-2014/reactive-geocoder
Early adopters 
• Checkpoint 
–Reactor 2.0.0.BUILD-SNAPSHOT implements 0.4.0.M2 - TCK OK 
–Akka Streams implements 0.4.0.M2 - TCK OK 
–Experiments started by RxJava 
–Ratpack 0.9.9.SNAPSHOT implements 0.4.0.M2 - TCK WIP 
! 
• Links 
–https://github.com/Netflix/RxJava 
–http://typesafe.com/blog/typesafe-announces-akka-streams 
–https://github.com/reactor/reactor 
–http://www.ratpack.io/manual/0.9.9/streams.html 
68
ReactiveStreams.onSubscribe(Resources) 
• www.reactive-streams.org 
• https://github.com/reactive-streams/reactive-streams 
! 
• on maven central : 0.4.0.M2 
– org.reactivestreams/reactive-streams 
! 
• Current TCK preview on repo.akka.io : 0.4.0.M2-SNAPSHOT 
– org.reactivestreams/reactive-streams-tck 
69
ReactiveStreams.onNext(Roadmap) 
• Discussed for inclusion in JDK 
• Close to release: 0.4.0 
– Evaluating TCK before going 0.4 final 
– TCK coverage by Akka Streams and Reactor 
– Need 3 passing implementations before going 1.0.0.M1 
70
Reactor.onSubscribe(Resources) 
• http://projectreactor.cfapps.io/ 
• https://github.com/reactor 
• Twitter: @projectReactor 
! 
• on maven central : 2.0.0.BUILD-SNAPSHOT 
– org.projectreactor/reactor 
71
Reactor.onNext(Roadmap) 
• Versions 
• Imminent 2.0.0.M1 
• 2.0.0.M2 - September 
• 2.0.0.RELEASE - End September/Early October 
• WIP: additional Stream operations, ecosystem upgrade, 
new starting guides 
72
Reactor.onError(issues) 
• Tracker: 
• https://github.com/reactor/reactor/issues 
! 
• Group: 
• https://groups.google.com/forum/?#!forum/reactor-framework 
73
74 
Q & A
session.onComplete() 
75

More Related Content

What's hot

Spring Boot on Amazon Web Services with Spring Cloud AWS
Spring Boot on Amazon Web Services with Spring Cloud AWSSpring Boot on Amazon Web Services with Spring Cloud AWS
Spring Boot on Amazon Web Services with Spring Cloud AWSVMware Tanzu
 
Can you trust Neutron?
Can you trust Neutron?Can you trust Neutron?
Can you trust Neutron?salv_orlando
 
Floodlight OpenFlow Contoller - Updated Overview
Floodlight OpenFlow Contoller - Updated OverviewFloodlight OpenFlow Contoller - Updated Overview
Floodlight OpenFlow Contoller - Updated Overviewopenflowhub
 
Dynatrace - Red Hat workshop : Monolith to Microservices
Dynatrace - Red Hat workshop : Monolith to MicroservicesDynatrace - Red Hat workshop : Monolith to Microservices
Dynatrace - Red Hat workshop : Monolith to MicroservicesSteve Caron
 
Tales From The Ship: Navigating the OpenStack Community Seas
Tales From The Ship: Navigating the OpenStack Community SeasTales From The Ship: Navigating the OpenStack Community Seas
Tales From The Ship: Navigating the OpenStack Community SeasMirantis
 
Simple tweaks to get the most out of your jvm
Simple tweaks to get the most out of your jvmSimple tweaks to get the most out of your jvm
Simple tweaks to get the most out of your jvmJamie Coleman
 
muCon 2014 "Building Java Microservices for the Cloud"
muCon 2014 "Building Java Microservices for the Cloud"muCon 2014 "Building Java Microservices for the Cloud"
muCon 2014 "Building Java Microservices for the Cloud"Daniel Bryant
 
Orchestraing the Blockchain Using Containers
Orchestraing the Blockchain Using ContainersOrchestraing the Blockchain Using Containers
Orchestraing the Blockchain Using ContainersAndrew Kennedy
 
Characterizing and contrasting kuhn tey-ner awr-kuh-streyt-ors
Characterizing and contrasting kuhn tey-ner awr-kuh-streyt-orsCharacterizing and contrasting kuhn tey-ner awr-kuh-streyt-ors
Characterizing and contrasting kuhn tey-ner awr-kuh-streyt-orsLee Calcote
 
Micronaut: Changing the Micro Future
Micronaut: Changing the Micro FutureMicronaut: Changing the Micro Future
Micronaut: Changing the Micro FutureZachary Klein
 
Azure Day Rome 2019 Reloaded - Strangle(r pattern) your legacy application ru...
Azure Day Rome 2019 Reloaded - Strangle(r pattern) your legacy application ru...Azure Day Rome 2019 Reloaded - Strangle(r pattern) your legacy application ru...
Azure Day Rome 2019 Reloaded - Strangle(r pattern) your legacy application ru...azuredayit
 
State of the Stack v4 - OpenStack in All It's Glory
State of the Stack v4 - OpenStack in All It's GloryState of the Stack v4 - OpenStack in All It's Glory
State of the Stack v4 - OpenStack in All It's GloryRandy Bias
 
J1 2015 "Debugging Java Apps in Containers: No Heavy Welding Gear Required"
J1 2015 "Debugging Java Apps in Containers: No Heavy Welding Gear Required"J1 2015 "Debugging Java Apps in Containers: No Heavy Welding Gear Required"
J1 2015 "Debugging Java Apps in Containers: No Heavy Welding Gear Required"Daniel Bryant
 
Things I wish someone had told me about Istio, Omer Levi Hevroni
Things I wish someone had told me about Istio, Omer Levi HevroniThings I wish someone had told me about Istio, Omer Levi Hevroni
Things I wish someone had told me about Istio, Omer Levi HevroniSoluto
 
Why jakarta ee matters (ConFoo 2021)
Why jakarta ee matters (ConFoo 2021)Why jakarta ee matters (ConFoo 2021)
Why jakarta ee matters (ConFoo 2021)Ryan Cuprak
 
Monitoring Akka with Kamon 1.0
Monitoring Akka with Kamon 1.0Monitoring Akka with Kamon 1.0
Monitoring Akka with Kamon 1.0Steffen Gebert
 
Next Generation Client APIs in Envoy Mobile
Next Generation Client APIs in Envoy MobileNext Generation Client APIs in Envoy Mobile
Next Generation Client APIs in Envoy MobileC4Media
 
Understand the Trade-offs Using Compilers for Java Applications
Understand the Trade-offs Using Compilers for Java ApplicationsUnderstand the Trade-offs Using Compilers for Java Applications
Understand the Trade-offs Using Compilers for Java ApplicationsC4Media
 
AWS Repatriation: Bring Your Apps Back
AWS Repatriation: Bring Your Apps BackAWS Repatriation: Bring Your Apps Back
AWS Repatriation: Bring Your Apps BackRandy Bias
 

What's hot (20)

Spring Boot on Amazon Web Services with Spring Cloud AWS
Spring Boot on Amazon Web Services with Spring Cloud AWSSpring Boot on Amazon Web Services with Spring Cloud AWS
Spring Boot on Amazon Web Services with Spring Cloud AWS
 
Can you trust Neutron?
Can you trust Neutron?Can you trust Neutron?
Can you trust Neutron?
 
Floodlight OpenFlow Contoller - Updated Overview
Floodlight OpenFlow Contoller - Updated OverviewFloodlight OpenFlow Contoller - Updated Overview
Floodlight OpenFlow Contoller - Updated Overview
 
Dynatrace - Red Hat workshop : Monolith to Microservices
Dynatrace - Red Hat workshop : Monolith to MicroservicesDynatrace - Red Hat workshop : Monolith to Microservices
Dynatrace - Red Hat workshop : Monolith to Microservices
 
Tales From The Ship: Navigating the OpenStack Community Seas
Tales From The Ship: Navigating the OpenStack Community SeasTales From The Ship: Navigating the OpenStack Community Seas
Tales From The Ship: Navigating the OpenStack Community Seas
 
Simple tweaks to get the most out of your jvm
Simple tweaks to get the most out of your jvmSimple tweaks to get the most out of your jvm
Simple tweaks to get the most out of your jvm
 
muCon 2014 "Building Java Microservices for the Cloud"
muCon 2014 "Building Java Microservices for the Cloud"muCon 2014 "Building Java Microservices for the Cloud"
muCon 2014 "Building Java Microservices for the Cloud"
 
Orchestraing the Blockchain Using Containers
Orchestraing the Blockchain Using ContainersOrchestraing the Blockchain Using Containers
Orchestraing the Blockchain Using Containers
 
Characterizing and contrasting kuhn tey-ner awr-kuh-streyt-ors
Characterizing and contrasting kuhn tey-ner awr-kuh-streyt-orsCharacterizing and contrasting kuhn tey-ner awr-kuh-streyt-ors
Characterizing and contrasting kuhn tey-ner awr-kuh-streyt-ors
 
Micronaut: Changing the Micro Future
Micronaut: Changing the Micro FutureMicronaut: Changing the Micro Future
Micronaut: Changing the Micro Future
 
Azure Day Rome 2019 Reloaded - Strangle(r pattern) your legacy application ru...
Azure Day Rome 2019 Reloaded - Strangle(r pattern) your legacy application ru...Azure Day Rome 2019 Reloaded - Strangle(r pattern) your legacy application ru...
Azure Day Rome 2019 Reloaded - Strangle(r pattern) your legacy application ru...
 
State of the Stack v4 - OpenStack in All It's Glory
State of the Stack v4 - OpenStack in All It's GloryState of the Stack v4 - OpenStack in All It's Glory
State of the Stack v4 - OpenStack in All It's Glory
 
J1 2015 "Debugging Java Apps in Containers: No Heavy Welding Gear Required"
J1 2015 "Debugging Java Apps in Containers: No Heavy Welding Gear Required"J1 2015 "Debugging Java Apps in Containers: No Heavy Welding Gear Required"
J1 2015 "Debugging Java Apps in Containers: No Heavy Welding Gear Required"
 
Things I wish someone had told me about Istio, Omer Levi Hevroni
Things I wish someone had told me about Istio, Omer Levi HevroniThings I wish someone had told me about Istio, Omer Levi Hevroni
Things I wish someone had told me about Istio, Omer Levi Hevroni
 
Why jakarta ee matters (ConFoo 2021)
Why jakarta ee matters (ConFoo 2021)Why jakarta ee matters (ConFoo 2021)
Why jakarta ee matters (ConFoo 2021)
 
Monitoring Akka with Kamon 1.0
Monitoring Akka with Kamon 1.0Monitoring Akka with Kamon 1.0
Monitoring Akka with Kamon 1.0
 
Micronaut Launchpad
Micronaut LaunchpadMicronaut Launchpad
Micronaut Launchpad
 
Next Generation Client APIs in Envoy Mobile
Next Generation Client APIs in Envoy MobileNext Generation Client APIs in Envoy Mobile
Next Generation Client APIs in Envoy Mobile
 
Understand the Trade-offs Using Compilers for Java Applications
Understand the Trade-offs Using Compilers for Java ApplicationsUnderstand the Trade-offs Using Compilers for Java Applications
Understand the Trade-offs Using Compilers for Java Applications
 
AWS Repatriation: Bring Your Apps Back
AWS Repatriation: Bring Your Apps BackAWS Repatriation: Bring Your Apps Back
AWS Repatriation: Bring Your Apps Back
 

Similar to Reactor and Reactive Streams Standard for Low Latency Applications

Journey into Reactive Streams and Akka Streams
Journey into Reactive Streams and Akka StreamsJourney into Reactive Streams and Akka Streams
Journey into Reactive Streams and Akka StreamsKevin Webber
 
Reactor, Reactive streams and MicroServices
Reactor, Reactive streams and MicroServicesReactor, Reactive streams and MicroServices
Reactor, Reactive streams and MicroServicesStéphane Maldini
 
3.2 Streaming and Messaging
3.2 Streaming and Messaging3.2 Streaming and Messaging
3.2 Streaming and Messaging振东 刘
 
Reactive programming with examples
Reactive programming with examplesReactive programming with examples
Reactive programming with examplesPeter Lawrey
 
Integrate Solr with real-time stream processing applications
Integrate Solr with real-time stream processing applicationsIntegrate Solr with real-time stream processing applications
Integrate Solr with real-time stream processing applicationsthelabdude
 
Reactive solutions using java 9 and spring reactor
Reactive solutions using java 9 and spring reactorReactive solutions using java 9 and spring reactor
Reactive solutions using java 9 and spring reactorOrenEzer1
 
Flexible and Real-Time Stream Processing with Apache Flink
Flexible and Real-Time Stream Processing with Apache FlinkFlexible and Real-Time Stream Processing with Apache Flink
Flexible and Real-Time Stream Processing with Apache FlinkDataWorks Summit
 
Reactive Streams 1.0.0 and Why You Should Care (webinar)
Reactive Streams 1.0.0 and Why You Should Care (webinar)Reactive Streams 1.0.0 and Why You Should Care (webinar)
Reactive Streams 1.0.0 and Why You Should Care (webinar)Legacy Typesafe (now Lightbend)
 
Apache Pulsar Overview
Apache Pulsar OverviewApache Pulsar Overview
Apache Pulsar OverviewStreamlio
 
Infrastructure at Scale: Apache Kafka, Twitter Storm & Elastic Search (ARC303...
Infrastructure at Scale: Apache Kafka, Twitter Storm & Elastic Search (ARC303...Infrastructure at Scale: Apache Kafka, Twitter Storm & Elastic Search (ARC303...
Infrastructure at Scale: Apache Kafka, Twitter Storm & Elastic Search (ARC303...Amazon Web Services
 
John adams talk cloudy
John adams   talk cloudyJohn adams   talk cloudy
John adams talk cloudyJohn Adams
 
Reactive Streams, Linking Reactive Application To Spark Streaming
Reactive Streams, Linking Reactive Application To Spark StreamingReactive Streams, Linking Reactive Application To Spark Streaming
Reactive Streams, Linking Reactive Application To Spark StreamingSpark Summit
 
AWS re:Invent presentation: Unmeltable Infrastructure at Scale by Loggly
AWS re:Invent presentation: Unmeltable Infrastructure at Scale by Loggly AWS re:Invent presentation: Unmeltable Infrastructure at Scale by Loggly
AWS re:Invent presentation: Unmeltable Infrastructure at Scale by Loggly SolarWinds Loggly
 
Reactive Streams - László van den Hoek
Reactive Streams - László van den HoekReactive Streams - László van den Hoek
Reactive Streams - László van den HoekRubiX BV
 
Spark (Structured) Streaming vs. Kafka Streams - two stream processing platfo...
Spark (Structured) Streaming vs. Kafka Streams - two stream processing platfo...Spark (Structured) Streaming vs. Kafka Streams - two stream processing platfo...
Spark (Structured) Streaming vs. Kafka Streams - two stream processing platfo...Guido Schmutz
 
Big Data Streams Architectures. Why? What? How?
Big Data Streams Architectures. Why? What? How?Big Data Streams Architectures. Why? What? How?
Big Data Streams Architectures. Why? What? How?Anton Nazaruk
 
Akka streams scala italy2015
Akka streams scala italy2015Akka streams scala italy2015
Akka streams scala italy2015mircodotta
 
Introduction to Storm
Introduction to Storm Introduction to Storm
Introduction to Storm Chandler Huang
 
Anton Moldovan "Building an efficient replication system for thousands of ter...
Anton Moldovan "Building an efficient replication system for thousands of ter...Anton Moldovan "Building an efficient replication system for thousands of ter...
Anton Moldovan "Building an efficient replication system for thousands of ter...Fwdays
 

Similar to Reactor and Reactive Streams Standard for Low Latency Applications (20)

Journey into Reactive Streams and Akka Streams
Journey into Reactive Streams and Akka StreamsJourney into Reactive Streams and Akka Streams
Journey into Reactive Streams and Akka Streams
 
Reactor, Reactive streams and MicroServices
Reactor, Reactive streams and MicroServicesReactor, Reactive streams and MicroServices
Reactor, Reactive streams and MicroServices
 
3.2 Streaming and Messaging
3.2 Streaming and Messaging3.2 Streaming and Messaging
3.2 Streaming and Messaging
 
Reactive programming with examples
Reactive programming with examplesReactive programming with examples
Reactive programming with examples
 
Typesafe spark- Zalando meetup
Typesafe spark- Zalando meetupTypesafe spark- Zalando meetup
Typesafe spark- Zalando meetup
 
Integrate Solr with real-time stream processing applications
Integrate Solr with real-time stream processing applicationsIntegrate Solr with real-time stream processing applications
Integrate Solr with real-time stream processing applications
 
Reactive solutions using java 9 and spring reactor
Reactive solutions using java 9 and spring reactorReactive solutions using java 9 and spring reactor
Reactive solutions using java 9 and spring reactor
 
Flexible and Real-Time Stream Processing with Apache Flink
Flexible and Real-Time Stream Processing with Apache FlinkFlexible and Real-Time Stream Processing with Apache Flink
Flexible and Real-Time Stream Processing with Apache Flink
 
Reactive Streams 1.0.0 and Why You Should Care (webinar)
Reactive Streams 1.0.0 and Why You Should Care (webinar)Reactive Streams 1.0.0 and Why You Should Care (webinar)
Reactive Streams 1.0.0 and Why You Should Care (webinar)
 
Apache Pulsar Overview
Apache Pulsar OverviewApache Pulsar Overview
Apache Pulsar Overview
 
Infrastructure at Scale: Apache Kafka, Twitter Storm & Elastic Search (ARC303...
Infrastructure at Scale: Apache Kafka, Twitter Storm & Elastic Search (ARC303...Infrastructure at Scale: Apache Kafka, Twitter Storm & Elastic Search (ARC303...
Infrastructure at Scale: Apache Kafka, Twitter Storm & Elastic Search (ARC303...
 
John adams talk cloudy
John adams   talk cloudyJohn adams   talk cloudy
John adams talk cloudy
 
Reactive Streams, Linking Reactive Application To Spark Streaming
Reactive Streams, Linking Reactive Application To Spark StreamingReactive Streams, Linking Reactive Application To Spark Streaming
Reactive Streams, Linking Reactive Application To Spark Streaming
 
AWS re:Invent presentation: Unmeltable Infrastructure at Scale by Loggly
AWS re:Invent presentation: Unmeltable Infrastructure at Scale by Loggly AWS re:Invent presentation: Unmeltable Infrastructure at Scale by Loggly
AWS re:Invent presentation: Unmeltable Infrastructure at Scale by Loggly
 
Reactive Streams - László van den Hoek
Reactive Streams - László van den HoekReactive Streams - László van den Hoek
Reactive Streams - László van den Hoek
 
Spark (Structured) Streaming vs. Kafka Streams - two stream processing platfo...
Spark (Structured) Streaming vs. Kafka Streams - two stream processing platfo...Spark (Structured) Streaming vs. Kafka Streams - two stream processing platfo...
Spark (Structured) Streaming vs. Kafka Streams - two stream processing platfo...
 
Big Data Streams Architectures. Why? What? How?
Big Data Streams Architectures. Why? What? How?Big Data Streams Architectures. Why? What? How?
Big Data Streams Architectures. Why? What? How?
 
Akka streams scala italy2015
Akka streams scala italy2015Akka streams scala italy2015
Akka streams scala italy2015
 
Introduction to Storm
Introduction to Storm Introduction to Storm
Introduction to Storm
 
Anton Moldovan "Building an efficient replication system for thousands of ter...
Anton Moldovan "Building an efficient replication system for thousands of ter...Anton Moldovan "Building an efficient replication system for thousands of ter...
Anton Moldovan "Building an efficient replication system for thousands of ter...
 

More from Stéphane Maldini

Multi-service reactive streams using Spring, Reactor, RSocket
Multi-service reactive streams using Spring, Reactor, RSocketMulti-service reactive streams using Spring, Reactor, RSocket
Multi-service reactive streams using Spring, Reactor, RSocketStéphane Maldini
 
The Future of Reactive Architectures
The Future of Reactive ArchitecturesThe Future of Reactive Architectures
The Future of Reactive ArchitecturesStéphane Maldini
 
What's new in Reactor Californium
What's new in Reactor CaliforniumWhat's new in Reactor Californium
What's new in Reactor CaliforniumStéphane Maldini
 
Spring boot 2.0 reactive bits (June 2018)
Spring boot 2.0 reactive bits (June 2018)Spring boot 2.0 reactive bits (June 2018)
Spring boot 2.0 reactive bits (June 2018)Stéphane Maldini
 
Reactor 3.0, a reactive foundation for java 8 and Spring
Reactor 3.0, a reactive foundation for java 8 and SpringReactor 3.0, a reactive foundation for java 8 and Spring
Reactor 3.0, a reactive foundation for java 8 and SpringStéphane Maldini
 
Intro to Reactive Programming
Intro to Reactive ProgrammingIntro to Reactive Programming
Intro to Reactive ProgrammingStéphane Maldini
 
Designing for Distributed Systems with Reactor and Reactive Streams
Designing for Distributed Systems with Reactor and Reactive StreamsDesigning for Distributed Systems with Reactor and Reactive Streams
Designing for Distributed Systems with Reactor and Reactive StreamsStéphane Maldini
 
Reactor grails realtime web devoxx 2013
Reactor grails realtime web   devoxx 2013Reactor grails realtime web   devoxx 2013
Reactor grails realtime web devoxx 2013Stéphane Maldini
 
Groovy reactor grails realtime web devoxx 2013
Groovy reactor grails realtime web   devoxx 2013Groovy reactor grails realtime web   devoxx 2013
Groovy reactor grails realtime web devoxx 2013Stéphane Maldini
 
Reactor spring one2gx_2013_0902-final
Reactor spring one2gx_2013_0902-finalReactor spring one2gx_2013_0902-final
Reactor spring one2gx_2013_0902-finalStéphane Maldini
 

More from Stéphane Maldini (14)

The value of reactive
The value of reactiveThe value of reactive
The value of reactive
 
Multi-service reactive streams using Spring, Reactor, RSocket
Multi-service reactive streams using Spring, Reactor, RSocketMulti-service reactive streams using Spring, Reactor, RSocket
Multi-service reactive streams using Spring, Reactor, RSocket
 
The Future of Reactive Architectures
The Future of Reactive ArchitecturesThe Future of Reactive Architectures
The Future of Reactive Architectures
 
Spring Cloud Gateway
Spring Cloud GatewaySpring Cloud Gateway
Spring Cloud Gateway
 
What's new in Reactor Californium
What's new in Reactor CaliforniumWhat's new in Reactor Californium
What's new in Reactor Californium
 
Spring boot 2.0 reactive bits (June 2018)
Spring boot 2.0 reactive bits (June 2018)Spring boot 2.0 reactive bits (June 2018)
Spring boot 2.0 reactive bits (June 2018)
 
Reactor 3.0, a reactive foundation for java 8 and Spring
Reactor 3.0, a reactive foundation for java 8 and SpringReactor 3.0, a reactive foundation for java 8 and Spring
Reactor 3.0, a reactive foundation for java 8 and Spring
 
Intro to Reactive Programming
Intro to Reactive ProgrammingIntro to Reactive Programming
Intro to Reactive Programming
 
Designing for Distributed Systems with Reactor and Reactive Streams
Designing for Distributed Systems with Reactor and Reactive StreamsDesigning for Distributed Systems with Reactor and Reactive Streams
Designing for Distributed Systems with Reactor and Reactive Streams
 
Reactor grails realtime web devoxx 2013
Reactor grails realtime web   devoxx 2013Reactor grails realtime web   devoxx 2013
Reactor grails realtime web devoxx 2013
 
Groovy reactor grails realtime web devoxx 2013
Groovy reactor grails realtime web   devoxx 2013Groovy reactor grails realtime web   devoxx 2013
Groovy reactor grails realtime web devoxx 2013
 
Ss2gx
Ss2gxSs2gx
Ss2gx
 
Reactor spring one2gx_2013_0902-final
Reactor spring one2gx_2013_0902-finalReactor spring one2gx_2013_0902-final
Reactor spring one2gx_2013_0902-final
 
Eventsggx
EventsggxEventsggx
Eventsggx
 

Recently uploaded

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
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
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
 
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
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
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
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
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
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
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
 
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
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 

Recently uploaded (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
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
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
 
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
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
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...
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
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
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 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)
 
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
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 

Reactor and Reactive Streams Standard for Low Latency Applications

  • 1. REACTOR AND THE REACTIVE STREAMS STANDARD Jon Brisbin - Stephane Maldini © 2014 SpringOne 2GX. All rights reserved. Do not distribute without permission. including plenty of lol™
  • 2. ‘Bout the guys speaking 2 ! @j_brisbin - 100% asynchronous poet Reactor Committer I Reactive-Streams Contributor ! @smaldini - solve 9 issues, create 10 problems Reactor Committer II Reactive-Streams Contributor
  • 3. Session Manifesto • Tweet questions during the presentation –@ProjectReactor ! • 90 minutes is long, plenty of time to fall asleep and awake in a storm of nonsense • Come chat with us after the session • Jump/Sleep to the last slide to find our coordinates 3
  • 4. 4
  • 5. Aperture Sciences Test 981: Observe the following examples 5 NanoService, MicroService, NotTooBigService™…
  • 6. NanoService, MicroService, NotTooBigService™… 6 cat file.csv | grep ‘doge’ | sort
  • 7. NanoService, MicroService, NotTooBigService™… 7 POST [json] http://dogecoin.money/send/id —> GET [json] http://dogeprofile.money/id —> POST [json] http://nsa.gov.us/cc/trace/id
  • 8. NanoService, MicroService, NotTooBigService™… 8 userService.auth(username,password) —> userService.hashPassword(password) —> userService.findByNameAndHash(name)
  • 9. NanoService, MicroService, NotTooBigService™… 9 • A SomethingService will always need to interact • With the user • With other services ! • The boundary between services is the real deal • A big danger lurks in the dark • More breakdown => More boundaries => Danger Will Robinson
  • 10. 10 And this threat has a name Latency
  • 11. 11 UberFact : Humans don’t really enjoy waiting Neither do The Machines
  • 12. What is latency doing to you ? 12 • Loss of revenues • because users switched to another site/app • because services are compounding inefficiency • because aggressive scaling will be needed • because dev budget will sink into addressing this a postiori ‘2 bucks prediction’ : tech team turnover will increase and keep mourning about how crap is their design
  • 14. All hail Reactive Programming • A possible answer to this issue • The very nature of Reactor, look at the name dude • A fancy buzz-word that might work better than MDA or SOA • A simple accumulation of years of engineering 14
  • 15. No sh*t, what is Reactive Programming ? 15 Event-Driven Fault-Tolerant Low-latency* Scalable
  • 16. Reactive Architecture ? • A Reactive system MUST be resilient –splitting concerns to achieve error bulk-heading and modularity ! • A Reactive system MUST be scalable – scale-up : partition work across CPUs – scale-out : distribute over peer nodes 16
  • 17. Reactive Architecture ! • Asynchronous Programming is core to Reactive Architecture • Immediate answer to the originating publisher • Context segregation to avoid cascade failure as possible ! • Functional Programming fits perfectly as it is stimulus based • Related: Functional Reactive Programming 17
  • 18. 18 Reactor has 99 problems but Latency isn’t one
  • 19. Reactor-Core features 19 [A]synchronous Dispatchers Event Bus [Reactor.class] Streams and Promises Functional artifacts (SAM components, tuples, timers) Fast IO [buffer, net, persistent queues, codec] Fast Data [allocators, batch-processors]
  • 20. Dispatching model matters • Context switching hurts performances • Locking hurts performances • Message passing hurts performances • Blocking for a thread hurts performances • Resources cost 20
  • 21. Built-in UberFast™ dispatcher • LMAX Disruptor deals with message passing issues • Based on a Ring Buffer structure • “Mechanical Sympathy” in Disruptor ! • http://lmax-exchange.github.com/disruptor/files/ Disruptor-1.0.pdf • http://mechanitis.blogspot.co.uk/2011/06/dissecting-disruptor-whats- so-special.html 21
  • 22. Message Passing matters • Pull vs Push patterns – Push: •Non blocking programming (e.g. lock-free LMAX RingBuffer) •Functional programming •Best for in-process short access ! – Pull: •Queue based decoupling •Best for slow services or blocking connections 22
  • 23. Reactor event bus in action In Groovy because Java doesn’t fit into the slide 23 import reactor.core.Environment import reactor.core.spec.Reactors import reactor.event.Event import static reactor.event.selector.Selectors.$ ! def env = new Environment() def r = Reactors.reactor(env) ! r.on($('welcome')) { name -> println "hello $name" Manage dispatchers Listen for names on Topic ‘welcome’ } ! r.notify($('welcome'), Event.wrap('Doge')) Reactor builder Send an Event to Topic ‘welcome’
  • 24. Reactor callback hell In Groovy because Java doesn’t fit into the slide 24 r.on($('talk')) { Event<String> speak -> 2nd level callback // do stuff with speak def topic = $("bye-$speak.headers.name") r.notify(topic, Event.wrap("$speak.data, much sad")) } ! r.on($('welcome')) { name -> r.on($("bye-$name")){ farewell -> println "bye bye ! $farewell... $name" } def event = Event.wrap('so wow') event.headers['name'] = name r.notify($('talk'), event) } ! r.notify($('welcome'), Event.wrap('Doge')) 1st level callback 3rd nested dynamic callback
  • 29. Solving callback hell 29 import reactor.rx.spec.Streams ! def stream = Streams.defer() ! stream.map{ name -> Tuple.of(name, 'so wow') }.map{ tuple -> Tuple.of(tuple.name, "$tuple.t2, much sad") }.consume{ tuple -> println "bye bye ! $tuple.t2... $tuple.t1" } ! stream.broadcastNext('Doge') Prepare a simple Stream 1st step 2nd step Terminal callback Send some data into the stream
  • 30. Using a Stream ? 30 Embedded data-processing Event Handling Metrics, Statistics Micro-Batching Composition Feedback-Loop
  • 31. Defining a Stream • Represents a sequence of data, possibly unbounded • Provide for processing API such as filtering and enrichment • Not a Collection, not a Storage 31
  • 32. Stream VS Event Bus [Reactor] 32 • Works great combined (stream distribution) • Type-checked flow • Publisher/Subscriber tight control • No Signal concurrency Rule of thumb: if nested event composition > 2, switch to Stream
  • 33. Hot Stream vs Cold Stream • An Hot Stream multi-casts real-time signals –think Trade, Tick, Mouse Click ! • A Cold Stream uni-casts deferred signals –think File, Array, Random 33
  • 34. 34 Introducing Reactive Streams Specification !
  • 35. What is defined by Reactive Streams ? 35 Async non-blocking flow-control Interoperable protocol Async non-blocking data sequence (Threads, Nodes…) Minimal resources requirement
  • 36. Reactive-Streams: Dynamic Message-Passing 36 PUBLISHER SUBSCRIBER Events Demand
  • 37. Now You Know • It is not only queue-based pattern: – Signaling demand on a slower Publisher == no buffering – Signaling demand on a faster Publisher == buffering ! • Data volume is bounded by a Subscriber – Scaling dynamically if required 37
  • 38. Out Of The Box : Flow Control 38 PUBLISHER SUBSCRIBER Slow Fast SUBSCRIBER
  • 39. Reactive Streams: Batch Processing ? • Requesting sized demand allows for batch publishing optimizations – Could be adapted dynamically based on criteria such as network bandwidth… – A Publisher could decide to apply grouped operations (aggregating, batch serializing) 39
  • 40. Reactive Streams: What is in the data sequence ? • If the Publisher is an Hot Stream – Sequence will be defined by when the Subscriber is connected ! • If the Publisher is a Cold Stream – Sequence will be similar for every Subscriber regardless of when they connected 40
  • 41. Reactive Streams: Transformations ? • Does not specify any transformation, only essentials components to enable this protocol… ! • …But define a staging component Processor : – Both A Subscriber AND a Publisher 41
  • 42. 42 Hold on a minute buddy, there are already Streams in Java 8 !
  • 43. All the “Streaming” tech around… Java 8 • Java 8 introduces java.util.stream.Stream – Functional DSL to support transformations and stages – Proactive fetching – No dynamic message passing – Fits nicely with event-driven libraries such as Reactor and RxJava. 43
  • 44. All the “Streaming” tech around… Java 8 44 Stream<Widget> widgetsStream = widgets.stream(); ! int sum = widgetsStream .filter(b -> b.getColor() == RED) .mapToInt(b -> b.getWeight()) .sum(); Pull operation Push operations Collection to Stream (Cold)
  • 45. What about RxJava mate ! All those hipsters use it. 45
  • 46. All the “Streaming” tech around… RxJava • RxJava provides the now famous Reactive Extensions – Rich transformations – Event-Driven (onNext, onError, onComplete) – Flexible scheduling – No dynamic demand OoB(possibly unbounded in-flight data) 46
  • 47. All the “Streaming” tech around… Java 8 47 Observe a Cold Stream numbers = Observable.from([1, 2, 3, 4, 5]); ! numbers.map({it * it}).subscribe( { println(it); }, // onNext { println("Error: " + it.getMessage()); }, // onError { println("Sequence complete"); } // onCompleted ); Push operations Demand ‘all’ data
  • 48. Other “Streaming” tech around… • Streaming data is all the rage in modern frameworks: – Akka, Storm, Reactor, Ratpack, … ! • Semantics compare with Enterprise Integration Patterns: – Camel, Spring Integration/XD, … – However it would technically take multiple channels to model a single Reactive Streams component (filter, transformer…) 48
  • 49. 49 Reactive Streams: Joining forces ccv Doug Lea – SUNY Oswego
  • 50. Reactive Streams: Joining forces 50 Reactor Data Driver Akka Distributed System RxJava Metrics Pipeline Ratpack HTTP server
  • 51. Reactive Streams: Joining forces ! • Smart solution and pattern to all reactive applications ! • Writing a standard protocol works best when it is used (!) ! • Beyond the JVM, initial discussions for network stack started 51
  • 52. Reactive Streams: Joining forces • Semantics – Single document listing full rules – Open enough to allow for various patterns ! • 4 API Interfaces – Publisher, Subscriber, Subscription, Processor ! • TCK to verify implementation behavior 52
  • 53. Reactive Streams: org.reactivestreams 53 public interface Publisher<T> { public void subscribe(Subscriber<T> s); } ! public interface Subscriber<T> { public void onSubscribe(Subscription s); public void onNext(T t); public void onError(Throwable t); public void onComplete(); } ! public interface Subscription { public void request(int n); public void cancel(); } public interface Processor<T, R> extends Subscriber<T>, Publisher<R> {}
  • 54. Reactive Streams: Reactor mapping 54 Publisher reactor.rx.Stream Subscriber reactor.rx.actions.Action Processor reactor.rx.Promise
  • 55. Reactive Streams: Execution Model • Publisher creates a capacity-aware container – Subscription per Subscriber ! • No concurrent notifications on a same Subscriber ! • Asynchronous or Synchronous – must not impact negatively calling code 55
  • 56. Reactive Streams: Signals 56 onError | (onSubscribe onNext* (onError | onComplete)?)
  • 57. Reactive Streams: Async Boundaries Resource #1 R2 R3 Resource #4 57 ! nioSelectorThreadOrigin map(f) filter(p) consume(toNioSelectorOutput)
  • 58. Reactive Streams: Async Boundaries Resource #1 Resource #4 58 ! nioSelectorThreadOrigin map(f) filter(p) consume(toNioSelectorOutput)
  • 59. Reactive Streams: Async Boundaries Resource #1 Resource #2 59 ! nioSelectorThreadOrigin map(f) filter(p) consume(toNioSelectorOutput)
  • 60. 10 slides and a demo to go :):):) 60
  • 61. Reactor : Iterable Cold Stream 61 Streams .defer(env, 1, 2, 3, 4, 5) .subscribe(identityProcessor);
  • 62. Reactor : Building blackbox processors 62 Processor<Integer,Integer> identityProcessor = Action.<Integer>passthrough(env.getDispatcher("ringBuffer")) .env(env) .capacity(bufferSize) .map(integer -> integer) .distinctUntilChanged() .flatMap(integer -> Promises.success(integer)) .filter(integer -> integer >= 0) .timeout(100) .combine();
  • 63. A Full Slide Just To Talk About flatMap() 63 FlatMap Bucket Challenge ! Nominate 3 friends to explain flatMap()
  • 64. Another Slide Just To Talk About flatMap() 64 flatMap() is nothing more than the functional alternative to RPC. Just a way to say “Ok bind this incoming data to this sub-flow and listen for the result, dude”.
  • 65. The Last Slide about flatMap() 65 stream.flatMap{ name -> Streams.defer(name) .observe{ println 'so wow' } .map{ 'much monad'} }.consume{ assert it == 'much monad' } Feed a dynamic Sub-Stream with a name Sub-Stream definition Sub-Stream result is merged back to the top-level Steam
  • 66. Reactor does also Scale-Up 66 deferred = Streams.defer(environment); deferred .parallel(8) .map(stream -> stream .map(i -> i) .reduce(2, service::reducePairAsMap) .consume(service::forwardToOutput) );
  • 68. Early adopters • Checkpoint –Reactor 2.0.0.BUILD-SNAPSHOT implements 0.4.0.M2 - TCK OK –Akka Streams implements 0.4.0.M2 - TCK OK –Experiments started by RxJava –Ratpack 0.9.9.SNAPSHOT implements 0.4.0.M2 - TCK WIP ! • Links –https://github.com/Netflix/RxJava –http://typesafe.com/blog/typesafe-announces-akka-streams –https://github.com/reactor/reactor –http://www.ratpack.io/manual/0.9.9/streams.html 68
  • 69. ReactiveStreams.onSubscribe(Resources) • www.reactive-streams.org • https://github.com/reactive-streams/reactive-streams ! • on maven central : 0.4.0.M2 – org.reactivestreams/reactive-streams ! • Current TCK preview on repo.akka.io : 0.4.0.M2-SNAPSHOT – org.reactivestreams/reactive-streams-tck 69
  • 70. ReactiveStreams.onNext(Roadmap) • Discussed for inclusion in JDK • Close to release: 0.4.0 – Evaluating TCK before going 0.4 final – TCK coverage by Akka Streams and Reactor – Need 3 passing implementations before going 1.0.0.M1 70
  • 71. Reactor.onSubscribe(Resources) • http://projectreactor.cfapps.io/ • https://github.com/reactor • Twitter: @projectReactor ! • on maven central : 2.0.0.BUILD-SNAPSHOT – org.projectreactor/reactor 71
  • 72. Reactor.onNext(Roadmap) • Versions • Imminent 2.0.0.M1 • 2.0.0.M2 - September • 2.0.0.RELEASE - End September/Early October • WIP: additional Stream operations, ecosystem upgrade, new starting guides 72
  • 73. Reactor.onError(issues) • Tracker: • https://github.com/reactor/reactor/issues ! • Group: • https://groups.google.com/forum/?#!forum/reactor-framework 73
  • 74. 74 Q & A