Spring 5 is here! One of the most exciting introductions in this release is support for Reactive Streams out of the Box!
Finally, the most popular java framework & ecosystem gets the reactive library it needs!
In this talk we look at its core features and demo how you can easily get started.
For 20 years Rory has developed and designed distributed enterprise systems .
He works full time in Research which gives him an unparalleled insight into industry movement.
For fun, he runs the Java, AWS and Kotlin User groups and races microservice driven cars.
3. A definition
Reactive Programming is all about non-blocking applications
that are asynchronous and event-driven and require a small
number of threads to scale
-Spring.io
4. What is Reactive Programming?
• Observer
• Interface to notify an object that the
next item in a sequence it is watching
it is available
• Streams
• Controlled exchange of stream data
across Applications
• Back-pressure
• control the flow of a Stream between
producer and consumer
6. What is Functional Reactive Programming?
Conal Elliot defined FRP back in 1998, in his paper "Functional
Reactive Animation”:
• “FRP expressions describe entire evolutions of values over
time, representing these evolutions directly as first-class
values
7. What is Functional reactive programming?
• Compositionality
• Being able to compose functions
• Immutability
• Guarantees inherently parallelisable
16. How do you test?
• curl -H "Accept: text/event-stream" http://localhost:8080/quotes-reactive
• Spring WebClient
• Spring WebTestClient
• Postman? Soapui? Browser?
17. Thoughts on Reactive Spring
• Pros
• Safer concurrency
• scale with a small, fixed number of threads and less
memory.
• makes applications more resilient under load because
they scale in a more predictable way
• Baked into Spring
• Java 10 Oracle Drivers Planned
18. Thoughts on Reactive Spring
• Cons
• Debugging complexity
• Steeeeeeep learning curve
• Do we understand Blocking?
• “it doesn’t matter if you use a Reactive Web approach in
the backend, it won’t be really reactive and non-blocking
unless your client is able to handle it as well”
19. Finally
• Source - https://github.com/roryp/full-reactive-stack
• Resources
• Project Reactor Site - https://projectreactor.io/
• Conal’s original paper https://github.com/conal/talk-2015-essence-and-
origins-of-frp