Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Eclipseday_2018.pdf

 Eclipseday_2018.pdf

Vidyasagar Machupalli

September 22, 2018
Tweet

More Decks by Vidyasagar Machupalli

Other Decks in Programming

Transcript

  1. 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
  2. 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
  3. #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
  4. 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
  5. 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 |
  6. 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
  7. 10 Mind the step… Why my simple application is such

    a mess... My Application Some Software & Data
  8. 12 Distributed systems fail How to stay responsive in face

    of failures, under varying workload My Application Some Software & Data
  9. 13 Distributed systems fail How to stay responsive in face

    of failures, under varying workload My Application Some Software & Data
  10. 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
  11. #vertx #reactive #rhoar @clementplop 18 Asynchronous message passing Sends to

    an address Subscribes to the address Message backbone
  12. #vertx #reactive #rhoar @clementplop 19 Asynchronous message passing Not blocked

    while waiting for a reply Message backbone Elasticity Resilience
  13. #vertx #reactive #rhoar @clementplop 21 Asynchronous execution Ideal world Task

    A Task B Task C Real world Blocking I/O Asynchronous execution
  14. 22 Asynchronous execution Asynchronous execution Async programming model Non-blocking IO

    Task-based concurrency This is what Eclipse Vert.x offers
  15. 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
  16. 24 Vert.x - the all-in-one toolkit Reactive A software showing

    responses to stimuli Reactive Systems Reactive Programming Reactive Streams
  17. 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…)