JavaOne Reakt 2016 - advantageous/j1-talks-2016 GitHub Wiki

Reactive Java: Promises and Streams with Reakt

Geoffrey Chandler

Rick Hightower

Abstract

Reakt is a reactive Java lib that provides promises, streams, and a reactor to handle asynchronous call coordination. It was influenced by the design of promises in ES6.

Scenario: You want to async-call serviceA and then serviceB, take the results of serviceA and serviceB, and then call serviceC. Then, based on the results of call C, call D or E and then return the results to the original caller. Calls to A, B, C, D, and E are all async calls, and none should take longer than 10 seconds. If they do, then return a timeout to the original caller. The whole async call sequence should time out in 20 seconds if it does not complete and should also check for circuit breakers and provide back pressure feedback so the system does not have cascading failures. Learn more in this session.

Outline

Origins

Vertx

Highspeed preference engine

Highspeed Oauth rate limiter

QBit reactor

ES6 promises

ES6 promises

then, catch

all, any

Async call coordination

then, catchError

all, any

Circuit breakers

Streams

Reactor to work with typed actors (manage timeouts)

Conclusion