”Everything is a stream“ - This often cited mantra indicates why Reactive Programming is such a powerful tool for handling data flows in almost every part of an application. Reactive Programming has experienced a significant growth in popularity in recent years. But its growing popularity also leads to a Babylonian confusion: the term ”Reactive“ has become overloaded and ”is now being associated with several different things to different people“ (Jonas Bonér, Viktor Klang). To understand what Reactive Programming is - and what it isn’t - this talk surveys the landscape sharpened by trends like Reactive Streams, Reactive Extensions and Reactive Systems. It then summarizes the basic principles of Reactive Programming by looking at the Reactor library and discusses examples, of how to use this library in a legacy system.
2. Who am I?
§ Florian Stefan
§ fstefan@ebay.com | @f_s_t_e_f_a_n
§ Software Engineer at mobile.de (eBay Classifieds Group)
§ JVM-based web applications in cloud environment
Introduction
3. Why am I here?
§ C10K problem in IoT project
§ Spring, Play, Netty, Node.js
§ Legacy Systems / Microservice Architectures
Introduction
8. The Reactive Manifesto
Reactive Systems
responsive
resilient
event-driven
scalable
scalable
react to load
responsive
react to user
resilient
react to failure
event-driven
react to events
99. Reactive Streams
§ Flow API in Java 9: java.util.concurrent.Flow
§ Standard for asynchronous stream processing
§ Pivotal, Lightbend, Netflix, Oracle, Red Hat and others
Reactive
Streams
Akka Streams
ReactorRxJava 2
Backpressure
Marble Diagrams
Function Composition with Higher
Order Functions
Functional
Programming
Declarative
Programming
REACTIVE
PROGRAMMING
REACTIVE
SYSTEMS
Reactive Extensions
Backpressure
100. Reactive Streams
public class Flow {
interface Processor<T, R> { ... }
interface Publisher<T> { ... }
interface Subscriber<T> { ... }
interface Subscription { ... }
}
Reactive
Streams
Akka Streams
ReactorRxJava 2
Backpressure
Marble Diagrams
Function Composition with Higher
Order Functions
Functional
Programming
Declarative
Programming
REACTIVE
PROGRAMMING
REACTIVE
SYSTEMS
Reactive Extensions
Backpressure
131. What‘s more?
§ Concurrency with publishOn and ParallelFlux
§ Declarative Error Handling
§ Logging and Monitoring
§ Cold Streams vs. Hot Streams
§ C10K and Non-blocking IO
§ Reactive Streams in the Web
Conclusion