Share
Embed
Transcript
28 slides
-
Reactive all the things ??? System eXtension s Programming Manifesto
Spring Streams Asynchrony Asynchronou s Scalability Resilience Elasticity Back- Pressure Spreadsheets Actor Data Flows Observable Events Message Reactor RX Java -
3 The reactive landscape Reactive A software showing responses to
stimuli Reactive Systems Reactive Streams Akka, Vert.x Reactor, Reactive Spring, Reactive eXtension, Vert.x Reactive Programming Akka Streams, RX v2, Reactor, Vert.x Data Flow Back-Pressure Non-Blocking, Asynchronous Manifesto, Actor Messages, Resilience Elasticity, Scalability, Asynchronous Streams, Flows, Events, Spreadsheets Asynchronous -
#vertx #reactive @clementplop 6 Streams as main construct Create data
streams Combine and transform Subscribe to observe the data and perform side-effects Reactive Programming -
A stream is a sequence of ongoing events ordered in
time. It can emit three different things: a value (of some type), an error, or a "completed" signal. Consider that the "completed" takes place, for instance, when the current window or view containing that button is closed. Images To Show Your Ideas https://gist.github.com/staltz/868e7e9bc2a7b8c1f754 -
8 stream .doOnNext(item -> System.out.println(item)) .doOnError(err -> err.printStackTrace()) .doOnComplete(() ->
System.out.println("End of stream")); Streams => 3 types of events 1 2 3 X | -
9 stream .map(item -> item + 1); 1 2 3
2 3 4 Combination of the best ideas from the Observer pattern, the Iterator pattern, and functional programming. Operators stream .flatMap(item -> Observable .fromArray(item, item)); 1 2 3 1 1 2 2 3 3 -
10 Mind the step… Why my simple application is such
a mess... My Application Some Software & Data -
11 Modern software is distributed... Remote interactions everywhere My Application
Some Software & Data -
12 Distributed systems fail How to stay responsive in face
of failures, under varying workload My Application Some Software & Data -
13 Distributed systems fail How to stay responsive in face
of failures, under varying workload My Application Some Software & Data -
14 The hidden truth being containers Containers are about sharing….
My App Some Software & Data Container -
15 The hidden truth being containers Containers are about sharing….
Thread-based execution model are not efficient in containers: • Too much memory • CPU quotas used to manage thread switch • Tuning thread pool is hard -
#vertx #reactive #rhoar @clementplop 18 Asynchronous message passing Sends to
an address Subscribes to the address Message backbone -
#vertx #reactive #rhoar @clementplop 19 Asynchronous message passing Not blocked
while waiting for a reply Message backbone Elasticity Resilience -
#vertx #reactive #rhoar @clementplop 21 Asynchronous execution Ideal world Task
A Task B Task C Real world Blocking I/O Asynchronous execution -
22 Asynchronous execution Asynchronous execution Async programming model Non-blocking IO
Task-based concurrency This is what Eclipse Vert.x offers -
23 Microservice, Web applications, IOT, API Gateway, High-volume event processing,
Full-blown backend message bus. Vert.x is a toolkit to build distributed and reactive systems Designed with reactive in mind Asynchronous non- blocking development models Simplified concurrency (event loop) Polyglot (java, scala, kotlin, groovy, ruby, ceylon…) Async and non- blocking ecosystem, (Clustered) event bus -
24 Vert.x - the all-in-one toolkit Reactive A software showing
responses to stimuli Reactive Systems Reactive Programming Reactive Streams -
25 JDBC, Async MySQL & Postgres, Redis, Mongo, Authentication, OAuth
Ecosystem & Community Service Discovery, Circuit Breaker, Health Check, Config RabbitMQ, AMQP, MQTT, Stomp, Kafka, Camel... HTTP, HTTP/2, gRPC, Service Proxies, TPC, UDP Metrics, Shell, Docker, Consul, Kubernetes (Clustered) event bus and bridges (SockJS, TCP…) -
#vertx #reactive #eclipsecon @clementplop 26 https://twitter.com/impurepics/status/1000466142866149377 Back Pressure Streams are
great… except when you can’t keep up! -
#vertx #reactive @clementplop 27 https://twitter.com/impurepics/status/1000466142866149377 Back Pressure Reactive Streams defines
an asynchronous and non- blocking back pressure protocol.