Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

of

Reactive Programming in Spring 5 Slide 1 Reactive Programming in Spring 5 Slide 2 Reactive Programming in Spring 5 Slide 3 Reactive Programming in Spring 5 Slide 4 Reactive Programming in Spring 5 Slide 5 Reactive Programming in Spring 5 Slide 6 Reactive Programming in Spring 5 Slide 7 Reactive Programming in Spring 5 Slide 8 Reactive Programming in Spring 5 Slide 9 Reactive Programming in Spring 5 Slide 10 Reactive Programming in Spring 5 Slide 11 Reactive Programming in Spring 5 Slide 12 Reactive Programming in Spring 5 Slide 13 Reactive Programming in Spring 5 Slide 14 Reactive Programming in Spring 5 Slide 15 Reactive Programming in Spring 5 Slide 16 Reactive Programming in Spring 5 Slide 17 Reactive Programming in Spring 5 Slide 18 Reactive Programming in Spring 5 Slide 19 Reactive Programming in Spring 5 Slide 20 Reactive Programming in Spring 5 Slide 21 Reactive Programming in Spring 5 Slide 22 Reactive Programming in Spring 5 Slide 23 Reactive Programming in Spring 5 Slide 24 Reactive Programming in Spring 5 Slide 25 Reactive Programming in Spring 5 Slide 26 Reactive Programming in Spring 5 Slide 27 Reactive Programming in Spring 5 Slide 28 Reactive Programming in Spring 5 Slide 29 Reactive Programming in Spring 5 Slide 30 Reactive Programming in Spring 5 Slide 31 Reactive Programming in Spring 5 Slide 32 Reactive Programming in Spring 5 Slide 33 Reactive Programming in Spring 5 Slide 34 Reactive Programming in Spring 5 Slide 35 Reactive Programming in Spring 5 Slide 36 Reactive Programming in Spring 5 Slide 37 Reactive Programming in Spring 5 Slide 38 Reactive Programming in Spring 5 Slide 39 Reactive Programming in Spring 5 Slide 40 Reactive Programming in Spring 5 Slide 41 Reactive Programming in Spring 5 Slide 42 Reactive Programming in Spring 5 Slide 43 Reactive Programming in Spring 5 Slide 44 Reactive Programming in Spring 5 Slide 45 Reactive Programming in Spring 5 Slide 46 Reactive Programming in Spring 5 Slide 47 Reactive Programming in Spring 5 Slide 48 Reactive Programming in Spring 5 Slide 49 Reactive Programming in Spring 5 Slide 50 Reactive Programming in Spring 5 Slide 51 Reactive Programming in Spring 5 Slide 52
Upcoming SlideShare
Reactive Spring Framework 5
Next
Download to read offline and view in fullscreen.

17 Likes

Share

Download to read offline

Reactive Programming in Spring 5

Download to read offline

Presented at Dutch Spring Meetup on 19-11-2015.

Related Books

Free with a 30 day trial from Scribd

See all

Related Audiobooks

Free with a 30 day trial from Scribd

See all

Reactive Programming in Spring 5

  1. 1. Reactive Programming in Spring 5 Arjen Poutsma Pivotal
  2. 2. About Arjen • Twenty years of experience in Enterprise Software Development • Joined SpringSource in 2005 • Development lead of Spring Web Services, Spring REST support, Spring Scala • Working on Spring 5
  3. 3. Agenda • Reactive Systems • Reactive Streams • RxJava • Reactor • Reactive Programming in Spring 5
  4. 4. Reactive Systems
  5. 5. Reactive Manifesto Responsive Message Driven ResilientElastic
  6. 6. Reactive Manifesto • Responsive • Rapid • Consistent • Resilient • Replication • Isolation • Elastic • Scaling • No bottlenecks • Message Driven • Async • Back-pressure
  7. 7. Reactive Streams
  8. 8. Reactive Streams Spec • Focus on Interoperability • No operators • Wide support • Akka,Vert.x, RxJava, Ratpack • JDK 9 Flow in java.util.concurrent
  9. 9. Publisher Subscriber
  10. 10. Publisher Subscribersubscribe
  11. 11. Publisher Subscriber
  12. 12. Publisher Subscriber
  13. 13. Publisher Subscriber onSubscribe Subscription
  14. 14. Publisher Subscriber Subscription
  15. 15. Subscription Publisher Subscriber
  16. 16. Subscription Publisher Subscriber request 2
  17. 17. Subscription Publisher Subscriber 2
  18. 18. Subscription Publisher Subscriber 2
  19. 19. Subscription Publisher Subscriber onNext 1
  20. 20. Subscription Publisher Subscriber 1
  21. 21. Subscription Publisher Subscriber onNext 0
  22. 22. Subscription Publisher Subscriber 0
  23. 23. Subscription Publisher Subscriber request 5
  24. 24. Subscription Publisher Subscriber 5
  25. 25. Subscription Publisher Subscriber 5
  26. 26. Subscription Publisher Subscriber onNext 4
  27. 27. Subscription Publisher Subscriber 4
  28. 28. Subscription Publisher Subscriber onNext 3
  29. 29. Subscription Publisher Subscriber 3
  30. 30. Subscription Publisher Subscriber onNext 2
  31. 31. Subscription Publisher Subscriber 2
  32. 32. Subscription Publisher Subscriber onComplete 2
  33. 33. Publisher Subscribersubscribe onSubscribe Subscription request onNext onComplete onError
  34. 34. Hot & Cold Cold Hot Passive Active Publish when subscribed Publish regardless Queue Mouse Movement
  35. 35. Operators • map, flatMap, take, subscribe, … • No Operators in Reactive Streams • Left to implementations
  36. 36. Reactor
  37. 37. Project Reactor • Stream extends Publisher • Wrap Publisher
  38. 38. Reactor Streams.just('a' 'b' 'c') .take(2) .map(Character::toUpperCase) .consume(System.out::println);
  39. 39. RxJava
  40. 40. RxJava • Based On Reactive Extensions • Ported to many languages • Rx.NET, RxJava, RxJS, ... • Native support for Reactive Streams coming in 2.x
  41. 41. RxJava Observable.just('a', 'b', 'c') .take(2) .map(Character::toUpperCase) .subscribe(System.out::println)
  42. 42. RxNetty • RxJava on top of Netty • Client/server for TCP and HTTP • Backpressure support
  43. 43. Spring 5
  44. 44. Spring Reactive • Experimental work for Spring 5 • Non-blocking runtimes: • Netty, Jetty,Tomcat, (Undertow) • RxJava, Reactor https://github.com/spring-projects/spring-reactive
  45. 45. public interface ServerHttpRequest { HttpMethod getMethod(); URI getURI(); InputStream getBody(); } public interface ServerHttpResponse { void setStatusCode(HttpStatus status); OutputStream getBody(); } HttpMessage
  46. 46. public interface ReactiveServerHttpRequest { HttpMethod getMethod(); URI getURI(); Publisher<ByteBuffer> getBody(); } public interface ServerHttpResponse { void setStatusCode(HttpStatus status); Publisher<void> setBody(Publisher<ByteBuffer> body); } Reactive HttpMessage
  47. 47. Reactive Wep App Web Service Data
  48. 48. Wanted: Reactiveness • JDBC • MySQL • Postgres • NoSQL • MongoDB • HTTP Client • OkHttp • Spring 5 • …
  49. 49. Reactor @RequestMapping("/capitalize") @ResponseBody public Stream<Person> capitalize( @RequestBody Stream<Person> persons) { return persons.map(person -> { person.setName(person.getName().toUpperCase()); return person; }); }
  50. 50. RxJava @RequestMapping("/capitalize") @ResponseBody public Observable<Person> capitalize( @RequestBody Observable<Person> persons) { return persons.map(person -> { person.setName(person.getName().toUpperCase()); return person; }); }
  51. 51. More Spring! Spring Meetup http://www.meetup.com/Dutch-Spring- Meetup/ Spring Track GOTO Amsterdam 2016 http://gotoams.com
  52. 52. Q & A https://github.com/spring-projects/spring-reactive
  • samanzone

    Nov. 14, 2019
  • siyufeifei

    Apr. 10, 2017
  • changhwanhan1

    Nov. 17, 2016
  • piotrwittchen

    Sep. 12, 2016
  • srinirengasamy7

    Jul. 31, 2016
  • factoradix

    Jun. 9, 2016
  • LuisMoraMedina

    Jun. 7, 2016
  • sandarkin

    May. 5, 2016
  • kirubakaran7

    Jan. 31, 2016
  • SreekumarGopalakrishnan1

    Jan. 21, 2016
  • AaronJung

    Dec. 11, 2015
  • objectx

    Dec. 1, 2015
  • YanAshenkampf

    Nov. 22, 2015
  • uhashimi

    Nov. 22, 2015
  • mythii

    Nov. 22, 2015
  • dongwq

    Nov. 22, 2015
  • ryojia

    Nov. 22, 2015

Presented at Dutch Spring Meetup on 19-11-2015.

Views

Total views

5,492

On Slideshare

0

From embeds

0

Number of embeds

68

Actions

Downloads

143

Shares

0

Comments

0

Likes

17

×