SlideShare una empresa de Scribd logo
1 de 46
Descargar para leer sin conexión
Nov 27, 2017
IPT – Intellectual
Products & Technologies
Reactive
Microservices
with Spring 5:
WebFlux
Trayan Iliev
tiliev@iproduct.org
http://iproduct.org
Copyright © 2003-2017 IPT - Intellectual
Products & Technologies
About me
2
Trayan Iliev
– CEO of IPT – Intellectual Products &
Technologies
– Oracle® certified programmer 15+ Y
– end-to-end reactive fullstack apps with Java,
ES6/7, TypeScript, Angular, React and Vue.js
– 12+ years IT trainer
– Voxxed Days, jPrime, jProfessionals,
BGOUG, BGJUG, DEV.BG speaker
– Organizer RoboLearn hackathons and IoT
enthusiast (http://robolearn.org)
3
Since 2003: IT Education Evolved
 Spring, Java SE/Web/EE 7/8/9, JSF
 Reactive IoT with Reactor / RxJava / RxJS
 Node.js + Express + React + Redux + GraphQL
 Angular + TypeScript + Redux (ngrx)
 SOA & REST HATEOAS
 DDD & Reactive Microservices
IPT - Intellectual Products & Technologies
http://www.iproduct.org
4
Reactive Microservices with Spring 5 WebFlux
 Introduction to FRP, Reactive Streams spec
 Project Reactor
 REST services with Spring 5: WebFlux
 Router, handler and filter functions
 Reactive repositories and reactive database access
with Spring Data. Building
 End-to-end non-blocking reactive SOA with Netty
 Reactive WebClients and integration testing
 Realtime event streaming to JS clients using SSE
5
Reactive Microservices with Spring 5 WebFlux
 Introduction to FRP, Reactive Streams spec
 Project Reactor
 REST services with Spring 5: WebFlux
 Router, handler and filter functions
 Reactive repositories and reactive database access
with Spring Data. Building
 End-to-end non-blocking reactive SOA with Netty
 Reactive WebClients and integration testing
 Realtime event streaming to JS clients using SSEBest Explained in Code
Where to Find the Demo Code?
6
Spring 5 WebFlux demos available @ GitHub:
https://github.com/iproduct/spring-5-webflux
Data / Event / Message Streams
7
“Conceptually, a stream is a (potentially never-ending)
flow of data records, and a transformation is an
operation that takes one or more streams as input,
and produces one or more output streams as a
result.”
Apache Flink: Dataflow Programming Model
Data Stream Programming
8
The idea of abstracting logic from execution is hardly
new -- it was the dream of SOA. And the recent
emergence of microservices and containers shows that
the dream still lives on.
For developers, the question is whether they want to
learn yet one more layer of abstraction to their coding.
On one hand, there's the elusive promise of a common
API to streaming engines that in theory should let you
mix and match, or swap in and swap out.
Tony Baer (Ovum) @ ZDNet - Apache Beam and Spark:
New coopetition for squashing the Lambda Architecture?
Lambda Architecture - I
9
https://commons.wikimedia.org/w/index.php?curid=34963986, By Textractor - Own work, CC BY-SA 4
Lambda Architecture - II
10
https://commons.wikimedia.org/w/index.php?curid=34963987, By Textractor - Own work, CC BY-SA 4
Lambda Architecture - III
11
 Data-processing architecture designed to handle
massive quantities of data by using both batch- and
stream-processing methods
 Balances latency, throughput, fault-tolerance, big
data, real-time analytics, mitigates the latencies of
map-reduce
 Data model with an append-only, immutable data
source that serves as a system of record
 Ingesting and processing timestamped events that are
appended to existing events. State is determined from
the natural time-based ordering of the data.
Druid Distributed Data Store (Java)
12
https://commons.wikimedia.org/w/index.php?curid=33899448 By Fangjin Yang - sent to me personally, GFDL
Apache
ZooKeeper
MySQL /
PostgreSQL
HDFS /
Amazon S3
Lambda Architecture: Projects - I
13
 Apache Spark is an open-source
cluster-computing framework. Spark
Streaming, Spark Mllib
 Apache Storm is a distributed
stream processing – streams DAG
 Apache Apex™ unified stream and
batch processing engine.
Lambda Architecture: Projects - II
 Apache Flink - open source stream
processing framework – Java, Scala
 Apache Kafka - open-source stream
processing (Kafka Streams), real-
time, low-latency, high-throughput,
massively scalable pub/sub
 Apache Beam – unified batch and
streaming, portable, extensible
Direct Acyclic Graphs - DAG
15
Synchronous vs. Asynchronous IO
16
DB
Synchronous
A
A
B
B
DB
Asynchronous
A
B
C
D
A
B
C
D
Example: Internet of Things (IoT)
17
CC BY 2.0, Source:
https://www.flickr.com/photos/wilgengebroed/8249565455/
Radar, GPS, lidar for navigation and obstacle
avoidance ( 2007 DARPA Urban Challenge )
IoT Services Architecture
18
Devices: Hardware + Embedded Software + Firmware
UART/ I2C/ 2G/ 3G/ LTE/ ZigBee/ 6LowPan/ BLE
Aggregation/ Bus: ESB, Message Broker
Device Gateway: Local Coordination and Event Aggregation
M2M: HTTP(/2) / WS / MQTT / CoAP
Management: TR-069 / OMA-DM / OMA LWM2M
HTTP, AMQP
Cloud (Micro)Service Mng.
Docker, Kubernetes/
Apache Brooklyn
Web/ Mobile
Portal
PaaSDashboard
PaaS API: Event Processing Services, Analytics
19
 Performance is about 2 things (Martin Thompson –
http://www.infoq.com/articles/low-latency-vp ):
– Throughput – units per second, and
– Latency – response time
 Real-time – time constraint from input to response
regardless of system load.
 Hard real-time system if this constraint is not honored then
a total system failure can occur.
 Soft real-time system – low latency response with little
deviation in response time
 100 nano-seconds to 100 milli-seconds. [Peter Lawrey]
What's High Performance?
20
 Low garbage by reusing existing objects + infrequent GC
when application not busy – can improve app 2 - 5x
 JVM generational GC startegy – ideal for objects living very
shortly (garbage collected next minor sweep) or be immortal
 Non-blocking, lockless coding or CAS
 Critical data structures – direct memory access using
DirectByteBuffers or Unsafe => predictable memory layout
and cache misses avoidance
 Busy waiting – giving the CPU to OS kernel slows program
2-5x => avoid context switches
 Amortize the effect of expensive IO - blocking
Low Latency: Things to Remember
Tracking Complexity
21
We need tools to cope with all that complexity
Simple solutions are needed – cope with problems
through divide and concur on different levels of
abstraction:
Domain Driven Design (DDD) – back to basics:
domain objects, data and logic.
Described by Eric Evans in his book:
Domain Driven Design: Tackling Complexity in the
Heart of Software, 2004
Domain Driven Design
22
Main concepts:
 Entities, value objects and modules
 Aggregates and Aggregate Roots [Haywood]:
value < entity < aggregate < module < BC
 Aggregate Roots are exposed as Open Host Services
 Repositories, Factories and Services:
application services <-> domain services
 Separating interface from implementation
Microservices and DDD
23
Actually DDD require additional efforts (as most other
divide and concur modeling approaches :)
 Ubiquitous language and Bounded Contexts
 Hexagonal architecture :
OUTSIDE <-> transformer <->
( application <-> domain )
Imperative and Reactive
24
We live in a Connected Universe
... there is hypothesis that all
the things in the Universe are
intimately connected, and you
can not change a bit without
changing all.
Action – Reaction principle is
the essence of how Universe
behaves.
Imperative and Reactive
 Reactive Programming: using static or dynamic data
flows and propagation of change
Example: a := b + c
 Functional Programming: evaluation of mathematical
functions,
➢ Avoids changing-state and mutable data, declarative
programming
➢ Side effects free => much easier to understand and
predict the program behavior.
Example: books.stream().filter(book -> book.getYear() > 2010)
.forEach( System.out::println )
Functional Reactive (FRP)
26
According to Connal Elliot's (ground-breaking paper @
Conference on Functional Programming, 1997), FRP is:
(a) Denotative
(b) Temporally continuous
Reactive Manifesto
27
[http://www.reactivemanifesto.org]
28
 Message Driven – asynchronous message-passing allows
to establish a boundary between components that ensures
loose coupling, isolation, location transparency, and
provides the means to delegate errors as messages
[Reactive Manifesto].
 The main idea is to separate concurrent producer and
consumer workers by using message queues.
 Message queues can be unbounded or bounded (limited
max number of messages)
 Unbounded message queues can present memory
allocation problem in case the producers outrun the
consumers for a long period → OutOfMemoryError
Scalable, Massively Concurrent
Reactive Programming
29
 Microsoft®
opens source polyglot project ReactiveX
(Reactive Extensions) [http://reactivex.io]:
Rx = Observables + LINQ + Schedulers :)
Java: RxJava, JavaScript: RxJS, C#: Rx.NET, Scala: RxScala,
Clojure: RxClojure, C++: RxCpp, Ruby: Rx.rb, Python: RxPY,
Groovy: RxGroovy, JRuby: RxJRuby, Kotlin: RxKotlin ...
 Reactive Streams Specification
[http://www.reactive-streams.org/] used by:
 (Spring) Project Reactor [http://projectreactor.io/]
 Actor Model – Akka (Java, Scala) [http://akka.io/]
Reactive Streams Spec.
30
 Reactive Streams – provides standard for
asynchronous stream processing with non-blocking
back pressure.
 Minimal set of interfaces, methods and protocols for
asynchronous data streams
 April 30, 2015: has been released version 1.0.0 of
Reactive Streams for the JVM (Java API,
Specification, TCK and implementation examples)
 Java 9: java.util.concurrent.Flow
Reactive Streams Spec.
31
 Publisher – provider of potentially unbounded number
of sequenced elements, according to Subscriber(s)
demand.
Publisher.subscribe(Subscriber) => onSubscribe onNext*
(onError | onComplete)?
 Subscriber – calls Subscription.request(long) to
receive notifications
 Subscription – one-to-one Subscriber ↔ Publisher,
request data and cancel demand (allow cleanup).
 Processor = Subscriber + Publisher
FRP = Async Data Streams
32
 FRP is asynchronous data-flow programming using the
building blocks of functional programming (e.g. map,
reduce, filter) and explicitly modeling time
 Used for GUIs, robotics, and music. Example (RxJava):
Observable.from(
new String[]{"Reactive", "Extensions", "Java"})
.take(2).map(s -> s + " : on " + new Date())
.subscribe(s -> System.out.println(s));
Result:
Reactive : on Wed Jun 17 21:54:02 GMT+02:00 2015
Extensions : on Wed Jun 17 21:54:02 GMT+02:00 2015
Project Reactor
33
 Reactor project allows building high-performance (low
latency high throughput) non-blocking asynchronous
applications on JVM.
 Reactor is designed to be extraordinarily fast and can
sustain throughput rates on order of 10's of millions of
operations per second.
 Reactor has powerful API for declaring data
transformations and functional composition.
 Makes use of the concept of Mechanical Sympathy
built on top of Disruptor / RingBuffer.
Reactor Projects
34
https://github.com/reactor/reactor, Apache Software License 2.0
IPC – Netty, Kafka, Aeron
Reactor Flux
35
https://github.com/reactor/reactor-core, Apache Software License 2.0
Example: Flux.combineLatest()
36
https://projectreactor.io/core/docs/api/, Apache Software License 2.0
Flux & Redux Design Patterns
Source: Flux in GitHub, https://github.com/facebook/flux, License: BSD 3-clause "New" License
Source: RxJava 2 API documentation, http://reactivex.io/RxJava/2.x/javadoc/
Redux == Rx Scan Opearator
Hot and Cold Event Streams
39
 PULL-based (Cold Event Streams) – Cold streams (e.g.
RxJava Observable / Flowable or Reactor Flow / Mono)
are streams that run their sequence when and if they
are subscribed to. They present the sequence from the
start to each subscriber.
 PUSH-based (Hot Event Streams) – emit values
independent of individual subscriptions. They have their
own timeline and events occur whether someone is
listening or not. When subscription is made observer
receives current events as they happen.
Example: mouse events
Converting Cold to Hot Stream
40
Hot Stream Example - Reactor
41
EmitterProcessor<String> emitter =
EmitterProcessor.create();
FluxSink<String> sink = emitter.sink();
emitter.publishOn(Schedulers.single())
.map(String::toUpperCase)
.filter(s -> s.startsWith("HELLO"))
.delayElements(Duration.of(1000, MILLIS))
.subscribe(System.out::println);
sink.next("Hello World!"); // emit - non blocking
sink.next("Goodbye World!");
sink.next("Hello Trayan!");
Thread.sleep(3000);
Top New Features in Spring 5
42
 Reactive Programming Model
 Spring Web Flux
 Reactive DB repositories & integrations + hot event
streaming: MongoDB, Redis, Cassandra, Kafka
 JDK 8+ and Java EE 7+ baseline
 Testing improvements
 Kotlin functional DSL
Project Reactor
Spring 5 Main Building Blocks
43Source: https://spring.io
Spring Boot 2.0
Reactive Stack
(async IO)
Servlet Stack
(one request per thread)
Spring Security Reactive
Every JEE Servlet Container
(tomact, jetty, undertow, ...)
Nonblocking NIO Runtimes
(Netty, Servlet 3.1 Containers)
Spring Security
Spring MVC Spring WebFlux
Spring Data Repositories
JDBC, JPA, NoSQL
Spring Data Reactive Repositories
Mongo, Cassandra, Redis, Couchbase
Multi-Threading
44
Reactor Threads
Java Native Thread Pool
(for blocking operations)
Threads
WebFlux: Best Expalined in Code
45
Lets see REST service Spring 5 WebFlux demos.
Available @GitHub:
https://github.com/iproduct/spring-5-webflux
Thank’s for Your Attention!
46
Trayan Iliev
CEO of IPT – Intellectual Products
& Technologies
http://iproduct.org/
http://robolearn.org/
https://github.com/iproduct
https://twitter.com/trayaniliev
https://www.facebook.com/IPT.EACAD
https://plus.google.com/+IproductOrg

Más contenido relacionado

La actualidad más candente

Scaling a Core Banking Engine Using Apache Kafka | Peter Dudbridge, Thought M...
Scaling a Core Banking Engine Using Apache Kafka | Peter Dudbridge, Thought M...Scaling a Core Banking Engine Using Apache Kafka | Peter Dudbridge, Thought M...
Scaling a Core Banking Engine Using Apache Kafka | Peter Dudbridge, Thought M...HostedbyConfluent
 
Reactive programming
Reactive programmingReactive programming
Reactive programmingSUDIP GHOSH
 
맛만 보자 액터 모델이란
맛만 보자 액터 모델이란 맛만 보자 액터 모델이란
맛만 보자 액터 모델이란 jbugkorea
 
Introduction and Overview of Apache Kafka, TriHUG July 23, 2013
Introduction and Overview of Apache Kafka, TriHUG July 23, 2013Introduction and Overview of Apache Kafka, TriHUG July 23, 2013
Introduction and Overview of Apache Kafka, TriHUG July 23, 2013mumrah
 
React js - The Core Concepts
React js - The Core ConceptsReact js - The Core Concepts
React js - The Core ConceptsDivyang Bhambhani
 
The Dual write problem
The Dual write problemThe Dual write problem
The Dual write problemJeppe Cramon
 
Reactive Programming in Java and Spring Framework 5
Reactive Programming in Java and Spring Framework 5Reactive Programming in Java and Spring Framework 5
Reactive Programming in Java and Spring Framework 5Richard Langlois P. Eng.
 
Micro services Architecture
Micro services ArchitectureMicro services Architecture
Micro services ArchitectureAraf Karsh Hamid
 
Introduction to Apache Kafka and Confluent... and why they matter
Introduction to Apache Kafka and Confluent... and why they matterIntroduction to Apache Kafka and Confluent... and why they matter
Introduction to Apache Kafka and Confluent... and why they matterconfluent
 
Building layers of defense for your application
Building layers of defense for your applicationBuilding layers of defense for your application
Building layers of defense for your applicationVMware Tanzu
 
Servlet vs Reactive Stacks in 5 Use Cases
Servlet vs Reactive Stacks in 5 Use CasesServlet vs Reactive Stacks in 5 Use Cases
Servlet vs Reactive Stacks in 5 Use CasesVMware Tanzu
 
Building and deploying microservices with event sourcing, CQRS and Docker (Be...
Building and deploying microservices with event sourcing, CQRS and Docker (Be...Building and deploying microservices with event sourcing, CQRS and Docker (Be...
Building and deploying microservices with event sourcing, CQRS and Docker (Be...Chris Richardson
 
Spring Boot Interview Questions | Edureka
Spring Boot Interview Questions | EdurekaSpring Boot Interview Questions | Edureka
Spring Boot Interview Questions | EdurekaEdureka!
 
Maintaining Consistency for a Financial Event-Driven Architecture (Iago Borge...
Maintaining Consistency for a Financial Event-Driven Architecture (Iago Borge...Maintaining Consistency for a Financial Event-Driven Architecture (Iago Borge...
Maintaining Consistency for a Financial Event-Driven Architecture (Iago Borge...confluent
 
Exactly-once Semantics in Apache Kafka
Exactly-once Semantics in Apache KafkaExactly-once Semantics in Apache Kafka
Exactly-once Semantics in Apache Kafkaconfluent
 
A Microservices approach with Cassandra and Quarkus | DevNation Tech Talk
A Microservices approach with Cassandra and Quarkus | DevNation Tech TalkA Microservices approach with Cassandra and Quarkus | DevNation Tech Talk
A Microservices approach with Cassandra and Quarkus | DevNation Tech TalkRed Hat Developers
 
Data Loss and Duplication in Kafka
Data Loss and Duplication in KafkaData Loss and Duplication in Kafka
Data Loss and Duplication in KafkaJayesh Thakrar
 
Apache Kafka Fundamentals for Architects, Admins and Developers
Apache Kafka Fundamentals for Architects, Admins and DevelopersApache Kafka Fundamentals for Architects, Admins and Developers
Apache Kafka Fundamentals for Architects, Admins and Developersconfluent
 

La actualidad más candente (20)

Scaling a Core Banking Engine Using Apache Kafka | Peter Dudbridge, Thought M...
Scaling a Core Banking Engine Using Apache Kafka | Peter Dudbridge, Thought M...Scaling a Core Banking Engine Using Apache Kafka | Peter Dudbridge, Thought M...
Scaling a Core Banking Engine Using Apache Kafka | Peter Dudbridge, Thought M...
 
Reactive programming
Reactive programmingReactive programming
Reactive programming
 
맛만 보자 액터 모델이란
맛만 보자 액터 모델이란 맛만 보자 액터 모델이란
맛만 보자 액터 모델이란
 
Introduction and Overview of Apache Kafka, TriHUG July 23, 2013
Introduction and Overview of Apache Kafka, TriHUG July 23, 2013Introduction and Overview of Apache Kafka, TriHUG July 23, 2013
Introduction and Overview of Apache Kafka, TriHUG July 23, 2013
 
React js - The Core Concepts
React js - The Core ConceptsReact js - The Core Concepts
React js - The Core Concepts
 
The Dual write problem
The Dual write problemThe Dual write problem
The Dual write problem
 
Project Reactor By Example
Project Reactor By ExampleProject Reactor By Example
Project Reactor By Example
 
Reactive Programming in Java and Spring Framework 5
Reactive Programming in Java and Spring Framework 5Reactive Programming in Java and Spring Framework 5
Reactive Programming in Java and Spring Framework 5
 
Micro services Architecture
Micro services ArchitectureMicro services Architecture
Micro services Architecture
 
Introduction to Apache Kafka and Confluent... and why they matter
Introduction to Apache Kafka and Confluent... and why they matterIntroduction to Apache Kafka and Confluent... and why they matter
Introduction to Apache Kafka and Confluent... and why they matter
 
Building layers of defense for your application
Building layers of defense for your applicationBuilding layers of defense for your application
Building layers of defense for your application
 
Servlet vs Reactive Stacks in 5 Use Cases
Servlet vs Reactive Stacks in 5 Use CasesServlet vs Reactive Stacks in 5 Use Cases
Servlet vs Reactive Stacks in 5 Use Cases
 
Building and deploying microservices with event sourcing, CQRS and Docker (Be...
Building and deploying microservices with event sourcing, CQRS and Docker (Be...Building and deploying microservices with event sourcing, CQRS and Docker (Be...
Building and deploying microservices with event sourcing, CQRS and Docker (Be...
 
Spring Boot Interview Questions | Edureka
Spring Boot Interview Questions | EdurekaSpring Boot Interview Questions | Edureka
Spring Boot Interview Questions | Edureka
 
Maintaining Consistency for a Financial Event-Driven Architecture (Iago Borge...
Maintaining Consistency for a Financial Event-Driven Architecture (Iago Borge...Maintaining Consistency for a Financial Event-Driven Architecture (Iago Borge...
Maintaining Consistency for a Financial Event-Driven Architecture (Iago Borge...
 
Exactly-once Semantics in Apache Kafka
Exactly-once Semantics in Apache KafkaExactly-once Semantics in Apache Kafka
Exactly-once Semantics in Apache Kafka
 
A Microservices approach with Cassandra and Quarkus | DevNation Tech Talk
A Microservices approach with Cassandra and Quarkus | DevNation Tech TalkA Microservices approach with Cassandra and Quarkus | DevNation Tech Talk
A Microservices approach with Cassandra and Quarkus | DevNation Tech Talk
 
Data Loss and Duplication in Kafka
Data Loss and Duplication in KafkaData Loss and Duplication in Kafka
Data Loss and Duplication in Kafka
 
Apache Kafka Fundamentals for Architects, Admins and Developers
Apache Kafka Fundamentals for Architects, Admins and DevelopersApache Kafka Fundamentals for Architects, Admins and Developers
Apache Kafka Fundamentals for Architects, Admins and Developers
 
Introduction to Apache Kafka
Introduction to Apache KafkaIntroduction to Apache Kafka
Introduction to Apache Kafka
 

Similar a Reactive Microservices with Spring 5: WebFlux

NGRX Apps in Depth
NGRX Apps in DepthNGRX Apps in Depth
NGRX Apps in DepthTrayan Iliev
 
Microservices with Spring 5 Webflux - jProfessionals
Microservices  with Spring 5 Webflux - jProfessionalsMicroservices  with Spring 5 Webflux - jProfessionals
Microservices with Spring 5 Webflux - jProfessionalsTrayan Iliev
 
Spring 5 Webflux - Advances in Java 2018
Spring 5 Webflux - Advances in Java 2018Spring 5 Webflux - Advances in Java 2018
Spring 5 Webflux - Advances in Java 2018Trayan Iliev
 
Reactive robotics io_t_2017
Reactive robotics io_t_2017Reactive robotics io_t_2017
Reactive robotics io_t_2017Trayan Iliev
 
Reactive Java Robotics IoT - jPrime 2016
Reactive Java Robotics IoT - jPrime 2016Reactive Java Robotics IoT - jPrime 2016
Reactive Java Robotics IoT - jPrime 2016Trayan Iliev
 
IPT High Performance Reactive Java BGOUG 2016
IPT High Performance Reactive Java BGOUG 2016IPT High Performance Reactive Java BGOUG 2016
IPT High Performance Reactive Java BGOUG 2016Trayan Iliev
 
Reactive Java Robotics and IoT - IPT Presentation @ Voxxed Days 2016
Reactive Java Robotics and IoT - IPT Presentation @ Voxxed Days 2016Reactive Java Robotics and IoT - IPT Presentation @ Voxxed Days 2016
Reactive Java Robotics and IoT - IPT Presentation @ Voxxed Days 2016Trayan Iliev
 
Making Machine Learning Easy with H2O and WebFlux
Making Machine Learning Easy with H2O and WebFluxMaking Machine Learning Easy with H2O and WebFlux
Making Machine Learning Easy with H2O and WebFluxTrayan Iliev
 
Reactive Java Robotics & IoT with Spring Reactor
Reactive Java Robotics & IoT with Spring ReactorReactive Java Robotics & IoT with Spring Reactor
Reactive Java Robotics & IoT with Spring ReactorTrayan Iliev
 
Stream Processing with CompletableFuture and Flow in Java 9
Stream Processing with CompletableFuture and Flow in Java 9Stream Processing with CompletableFuture and Flow in Java 9
Stream Processing with CompletableFuture and Flow in Java 9Trayan Iliev
 
Reactive Java Robotics and IoT 2016
Reactive Java Robotics and IoT 2016Reactive Java Robotics and IoT 2016
Reactive Java Robotics and IoT 2016ilievt
 
Red Hat Java Update and Quarkus Introduction
Red Hat Java Update and Quarkus IntroductionRed Hat Java Update and Quarkus Introduction
Red Hat Java Update and Quarkus IntroductionJohn Archer
 
UniK - a unikernel compiler and runtime
UniK - a unikernel compiler and runtimeUniK - a unikernel compiler and runtime
UniK - a unikernel compiler and runtimeLee Calcote
 
Java & JavaScipt Reactive Robotics and IoT 2016 @ jProfessionals
Java & JavaScipt Reactive Robotics and IoT 2016 @ jProfessionalsJava & JavaScipt Reactive Robotics and IoT 2016 @ jProfessionals
Java & JavaScipt Reactive Robotics and IoT 2016 @ jProfessionalsTrayan Iliev
 
OCCIware presentation at EclipseDay in Lyon, November 2017, by Marc Dutoo, Smile
OCCIware presentation at EclipseDay in Lyon, November 2017, by Marc Dutoo, SmileOCCIware presentation at EclipseDay in Lyon, November 2017, by Marc Dutoo, Smile
OCCIware presentation at EclipseDay in Lyon, November 2017, by Marc Dutoo, SmileOCCIware
 
Model and pilot all cloud layers with OCCIware - Eclipse Day Lyon 2017
Model and pilot all cloud layers with OCCIware - Eclipse Day Lyon 2017Model and pilot all cloud layers with OCCIware - Eclipse Day Lyon 2017
Model and pilot all cloud layers with OCCIware - Eclipse Day Lyon 2017Marc Dutoo
 
Cytoscape CI Chapter 2
Cytoscape CI Chapter 2Cytoscape CI Chapter 2
Cytoscape CI Chapter 2bdemchak
 
Akka.Net and .Net Core - The Developer Conference 2018 Florianopolis
Akka.Net and .Net Core - The Developer Conference 2018 FlorianopolisAkka.Net and .Net Core - The Developer Conference 2018 Florianopolis
Akka.Net and .Net Core - The Developer Conference 2018 FlorianopolisAlexandre Brandão Lustosa
 
IT TRENDS AND PERSPECTIVES 2016
IT TRENDS AND PERSPECTIVES 2016IT TRENDS AND PERSPECTIVES 2016
IT TRENDS AND PERSPECTIVES 2016Vaidheswaran CS
 
IPT Reactive Java IoT Demo - BGOUG 2018
IPT Reactive Java IoT Demo - BGOUG 2018IPT Reactive Java IoT Demo - BGOUG 2018
IPT Reactive Java IoT Demo - BGOUG 2018Trayan Iliev
 

Similar a Reactive Microservices with Spring 5: WebFlux (20)

NGRX Apps in Depth
NGRX Apps in DepthNGRX Apps in Depth
NGRX Apps in Depth
 
Microservices with Spring 5 Webflux - jProfessionals
Microservices  with Spring 5 Webflux - jProfessionalsMicroservices  with Spring 5 Webflux - jProfessionals
Microservices with Spring 5 Webflux - jProfessionals
 
Spring 5 Webflux - Advances in Java 2018
Spring 5 Webflux - Advances in Java 2018Spring 5 Webflux - Advances in Java 2018
Spring 5 Webflux - Advances in Java 2018
 
Reactive robotics io_t_2017
Reactive robotics io_t_2017Reactive robotics io_t_2017
Reactive robotics io_t_2017
 
Reactive Java Robotics IoT - jPrime 2016
Reactive Java Robotics IoT - jPrime 2016Reactive Java Robotics IoT - jPrime 2016
Reactive Java Robotics IoT - jPrime 2016
 
IPT High Performance Reactive Java BGOUG 2016
IPT High Performance Reactive Java BGOUG 2016IPT High Performance Reactive Java BGOUG 2016
IPT High Performance Reactive Java BGOUG 2016
 
Reactive Java Robotics and IoT - IPT Presentation @ Voxxed Days 2016
Reactive Java Robotics and IoT - IPT Presentation @ Voxxed Days 2016Reactive Java Robotics and IoT - IPT Presentation @ Voxxed Days 2016
Reactive Java Robotics and IoT - IPT Presentation @ Voxxed Days 2016
 
Making Machine Learning Easy with H2O and WebFlux
Making Machine Learning Easy with H2O and WebFluxMaking Machine Learning Easy with H2O and WebFlux
Making Machine Learning Easy with H2O and WebFlux
 
Reactive Java Robotics & IoT with Spring Reactor
Reactive Java Robotics & IoT with Spring ReactorReactive Java Robotics & IoT with Spring Reactor
Reactive Java Robotics & IoT with Spring Reactor
 
Stream Processing with CompletableFuture and Flow in Java 9
Stream Processing with CompletableFuture and Flow in Java 9Stream Processing with CompletableFuture and Flow in Java 9
Stream Processing with CompletableFuture and Flow in Java 9
 
Reactive Java Robotics and IoT 2016
Reactive Java Robotics and IoT 2016Reactive Java Robotics and IoT 2016
Reactive Java Robotics and IoT 2016
 
Red Hat Java Update and Quarkus Introduction
Red Hat Java Update and Quarkus IntroductionRed Hat Java Update and Quarkus Introduction
Red Hat Java Update and Quarkus Introduction
 
UniK - a unikernel compiler and runtime
UniK - a unikernel compiler and runtimeUniK - a unikernel compiler and runtime
UniK - a unikernel compiler and runtime
 
Java & JavaScipt Reactive Robotics and IoT 2016 @ jProfessionals
Java & JavaScipt Reactive Robotics and IoT 2016 @ jProfessionalsJava & JavaScipt Reactive Robotics and IoT 2016 @ jProfessionals
Java & JavaScipt Reactive Robotics and IoT 2016 @ jProfessionals
 
OCCIware presentation at EclipseDay in Lyon, November 2017, by Marc Dutoo, Smile
OCCIware presentation at EclipseDay in Lyon, November 2017, by Marc Dutoo, SmileOCCIware presentation at EclipseDay in Lyon, November 2017, by Marc Dutoo, Smile
OCCIware presentation at EclipseDay in Lyon, November 2017, by Marc Dutoo, Smile
 
Model and pilot all cloud layers with OCCIware - Eclipse Day Lyon 2017
Model and pilot all cloud layers with OCCIware - Eclipse Day Lyon 2017Model and pilot all cloud layers with OCCIware - Eclipse Day Lyon 2017
Model and pilot all cloud layers with OCCIware - Eclipse Day Lyon 2017
 
Cytoscape CI Chapter 2
Cytoscape CI Chapter 2Cytoscape CI Chapter 2
Cytoscape CI Chapter 2
 
Akka.Net and .Net Core - The Developer Conference 2018 Florianopolis
Akka.Net and .Net Core - The Developer Conference 2018 FlorianopolisAkka.Net and .Net Core - The Developer Conference 2018 Florianopolis
Akka.Net and .Net Core - The Developer Conference 2018 Florianopolis
 
IT TRENDS AND PERSPECTIVES 2016
IT TRENDS AND PERSPECTIVES 2016IT TRENDS AND PERSPECTIVES 2016
IT TRENDS AND PERSPECTIVES 2016
 
IPT Reactive Java IoT Demo - BGOUG 2018
IPT Reactive Java IoT Demo - BGOUG 2018IPT Reactive Java IoT Demo - BGOUG 2018
IPT Reactive Java IoT Demo - BGOUG 2018
 

Más de Trayan Iliev

Rapid Web API development with Kotlin and Ktor
Rapid Web API development with Kotlin and KtorRapid Web API development with Kotlin and Ktor
Rapid Web API development with Kotlin and KtorTrayan Iliev
 
Learning Programming Using Robots - Sofia University Conference 2018
Learning Programming Using Robots - Sofia University Conference 2018 Learning Programming Using Robots - Sofia University Conference 2018
Learning Programming Using Robots - Sofia University Conference 2018 Trayan Iliev
 
Active Learning Using Connected Things - 2018 (in Bulgarian)
Active Learning Using Connected Things - 2018 (in Bulgarian)Active Learning Using Connected Things - 2018 (in Bulgarian)
Active Learning Using Connected Things - 2018 (in Bulgarian)Trayan Iliev
 
Fog Computing - DEV.BG 2018
Fog Computing - DEV.BG 2018Fog Computing - DEV.BG 2018
Fog Computing - DEV.BG 2018Trayan Iliev
 
What's new in java 9?
What's new in java 9?What's new in java 9?
What's new in java 9?Trayan Iliev
 
React HOCs, Context and Observables
React HOCs, Context and ObservablesReact HOCs, Context and Observables
React HOCs, Context and ObservablesTrayan Iliev
 
Hackathon: “IPTPI and LeJaRo Meet The Real World”
Hackathon: “IPTPI and LeJaRo Meet The Real World”Hackathon: “IPTPI and LeJaRo Meet The Real World”
Hackathon: “IPTPI and LeJaRo Meet The Real World”Trayan Iliev
 
IPT angular2 typescript SPA 2016
IPT angular2 typescript SPA 2016IPT angular2 typescript SPA 2016
IPT angular2 typescript SPA 2016Trayan Iliev
 
New MVC 1.0 JavaEE 8 API
New MVC 1.0 JavaEE 8 APINew MVC 1.0 JavaEE 8 API
New MVC 1.0 JavaEE 8 APITrayan Iliev
 
IPT High Performance Reactive Programming with JAVA 8 and JavaScript
IPT High Performance Reactive Programming with JAVA 8 and JavaScriptIPT High Performance Reactive Programming with JAVA 8 and JavaScript
IPT High Performance Reactive Programming with JAVA 8 and JavaScriptTrayan Iliev
 
IPT Workshops on Java Robotics and IoT
IPT Workshops on Java Robotics and IoTIPT Workshops on Java Robotics and IoT
IPT Workshops on Java Robotics and IoTTrayan Iliev
 
IPT – Java Robotics and IoT
IPT – Java Robotics and IoTIPT – Java Robotics and IoT
IPT – Java Robotics and IoTTrayan Iliev
 
Novelties in Java EE 7: JAX-RS 2.0 + IPT REST HATEOAS Polling Demo @ BGOUG Co...
Novelties in Java EE 7: JAX-RS 2.0 + IPT REST HATEOAS Polling Demo @ BGOUG Co...Novelties in Java EE 7: JAX-RS 2.0 + IPT REST HATEOAS Polling Demo @ BGOUG Co...
Novelties in Java EE 7: JAX-RS 2.0 + IPT REST HATEOAS Polling Demo @ BGOUG Co...Trayan Iliev
 

Más de Trayan Iliev (13)

Rapid Web API development with Kotlin and Ktor
Rapid Web API development with Kotlin and KtorRapid Web API development with Kotlin and Ktor
Rapid Web API development with Kotlin and Ktor
 
Learning Programming Using Robots - Sofia University Conference 2018
Learning Programming Using Robots - Sofia University Conference 2018 Learning Programming Using Robots - Sofia University Conference 2018
Learning Programming Using Robots - Sofia University Conference 2018
 
Active Learning Using Connected Things - 2018 (in Bulgarian)
Active Learning Using Connected Things - 2018 (in Bulgarian)Active Learning Using Connected Things - 2018 (in Bulgarian)
Active Learning Using Connected Things - 2018 (in Bulgarian)
 
Fog Computing - DEV.BG 2018
Fog Computing - DEV.BG 2018Fog Computing - DEV.BG 2018
Fog Computing - DEV.BG 2018
 
What's new in java 9?
What's new in java 9?What's new in java 9?
What's new in java 9?
 
React HOCs, Context and Observables
React HOCs, Context and ObservablesReact HOCs, Context and Observables
React HOCs, Context and Observables
 
Hackathon: “IPTPI and LeJaRo Meet The Real World”
Hackathon: “IPTPI and LeJaRo Meet The Real World”Hackathon: “IPTPI and LeJaRo Meet The Real World”
Hackathon: “IPTPI and LeJaRo Meet The Real World”
 
IPT angular2 typescript SPA 2016
IPT angular2 typescript SPA 2016IPT angular2 typescript SPA 2016
IPT angular2 typescript SPA 2016
 
New MVC 1.0 JavaEE 8 API
New MVC 1.0 JavaEE 8 APINew MVC 1.0 JavaEE 8 API
New MVC 1.0 JavaEE 8 API
 
IPT High Performance Reactive Programming with JAVA 8 and JavaScript
IPT High Performance Reactive Programming with JAVA 8 and JavaScriptIPT High Performance Reactive Programming with JAVA 8 and JavaScript
IPT High Performance Reactive Programming with JAVA 8 and JavaScript
 
IPT Workshops on Java Robotics and IoT
IPT Workshops on Java Robotics and IoTIPT Workshops on Java Robotics and IoT
IPT Workshops on Java Robotics and IoT
 
IPT – Java Robotics and IoT
IPT – Java Robotics and IoTIPT – Java Robotics and IoT
IPT – Java Robotics and IoT
 
Novelties in Java EE 7: JAX-RS 2.0 + IPT REST HATEOAS Polling Demo @ BGOUG Co...
Novelties in Java EE 7: JAX-RS 2.0 + IPT REST HATEOAS Polling Demo @ BGOUG Co...Novelties in Java EE 7: JAX-RS 2.0 + IPT REST HATEOAS Polling Demo @ BGOUG Co...
Novelties in Java EE 7: JAX-RS 2.0 + IPT REST HATEOAS Polling Demo @ BGOUG Co...
 

Último

Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEEVICTOR MAESTRE RAMIREZ
 
MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based projectAnoyGreter
 
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Natan Silnitsky
 
Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Hr365.us smith
 
CRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceCRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceBrainSell Technologies
 
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Angel Borroy López
 
SpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at RuntimeSpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at Runtimeandrehoraa
 
Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)Ahmed Mater
 
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdf
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdfExploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdf
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdfkalichargn70th171
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureDinusha Kumarasiri
 
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesPhilip Schwarz
 
Introduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdfIntroduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdfFerryKemperman
 
SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving CarsSensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving CarsChristian Birchler
 
VK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web DevelopmentVK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web Developmentvyaparkranti
 
Machine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their EngineeringMachine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their EngineeringHironori Washizaki
 
cpct NetworkING BASICS AND NETWORK TOOL.ppt
cpct NetworkING BASICS AND NETWORK TOOL.pptcpct NetworkING BASICS AND NETWORK TOOL.ppt
cpct NetworkING BASICS AND NETWORK TOOL.pptrcbcrtm
 
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...confluent
 
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...OnePlan Solutions
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsAhmed Mohamed
 

Último (20)

Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEE
 
MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based project
 
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
 
Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)
 
CRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceCRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. Salesforce
 
Odoo Development Company in India | Devintelle Consulting Service
Odoo Development Company in India | Devintelle Consulting ServiceOdoo Development Company in India | Devintelle Consulting Service
Odoo Development Company in India | Devintelle Consulting Service
 
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
 
SpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at RuntimeSpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at Runtime
 
Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)
 
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdf
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdfExploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdf
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdf
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with Azure
 
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a series
 
Introduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdfIntroduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdf
 
SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving CarsSensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
 
VK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web DevelopmentVK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web Development
 
Machine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their EngineeringMachine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their Engineering
 
cpct NetworkING BASICS AND NETWORK TOOL.ppt
cpct NetworkING BASICS AND NETWORK TOOL.pptcpct NetworkING BASICS AND NETWORK TOOL.ppt
cpct NetworkING BASICS AND NETWORK TOOL.ppt
 
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
 
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML Diagrams
 

Reactive Microservices with Spring 5: WebFlux

  • 1. Nov 27, 2017 IPT – Intellectual Products & Technologies Reactive Microservices with Spring 5: WebFlux Trayan Iliev tiliev@iproduct.org http://iproduct.org Copyright © 2003-2017 IPT - Intellectual Products & Technologies
  • 2. About me 2 Trayan Iliev – CEO of IPT – Intellectual Products & Technologies – Oracle® certified programmer 15+ Y – end-to-end reactive fullstack apps with Java, ES6/7, TypeScript, Angular, React and Vue.js – 12+ years IT trainer – Voxxed Days, jPrime, jProfessionals, BGOUG, BGJUG, DEV.BG speaker – Organizer RoboLearn hackathons and IoT enthusiast (http://robolearn.org)
  • 3. 3 Since 2003: IT Education Evolved  Spring, Java SE/Web/EE 7/8/9, JSF  Reactive IoT with Reactor / RxJava / RxJS  Node.js + Express + React + Redux + GraphQL  Angular + TypeScript + Redux (ngrx)  SOA & REST HATEOAS  DDD & Reactive Microservices IPT - Intellectual Products & Technologies http://www.iproduct.org
  • 4. 4 Reactive Microservices with Spring 5 WebFlux  Introduction to FRP, Reactive Streams spec  Project Reactor  REST services with Spring 5: WebFlux  Router, handler and filter functions  Reactive repositories and reactive database access with Spring Data. Building  End-to-end non-blocking reactive SOA with Netty  Reactive WebClients and integration testing  Realtime event streaming to JS clients using SSE
  • 5. 5 Reactive Microservices with Spring 5 WebFlux  Introduction to FRP, Reactive Streams spec  Project Reactor  REST services with Spring 5: WebFlux  Router, handler and filter functions  Reactive repositories and reactive database access with Spring Data. Building  End-to-end non-blocking reactive SOA with Netty  Reactive WebClients and integration testing  Realtime event streaming to JS clients using SSEBest Explained in Code
  • 6. Where to Find the Demo Code? 6 Spring 5 WebFlux demos available @ GitHub: https://github.com/iproduct/spring-5-webflux
  • 7. Data / Event / Message Streams 7 “Conceptually, a stream is a (potentially never-ending) flow of data records, and a transformation is an operation that takes one or more streams as input, and produces one or more output streams as a result.” Apache Flink: Dataflow Programming Model
  • 8. Data Stream Programming 8 The idea of abstracting logic from execution is hardly new -- it was the dream of SOA. And the recent emergence of microservices and containers shows that the dream still lives on. For developers, the question is whether they want to learn yet one more layer of abstraction to their coding. On one hand, there's the elusive promise of a common API to streaming engines that in theory should let you mix and match, or swap in and swap out. Tony Baer (Ovum) @ ZDNet - Apache Beam and Spark: New coopetition for squashing the Lambda Architecture?
  • 9. Lambda Architecture - I 9 https://commons.wikimedia.org/w/index.php?curid=34963986, By Textractor - Own work, CC BY-SA 4
  • 10. Lambda Architecture - II 10 https://commons.wikimedia.org/w/index.php?curid=34963987, By Textractor - Own work, CC BY-SA 4
  • 11. Lambda Architecture - III 11  Data-processing architecture designed to handle massive quantities of data by using both batch- and stream-processing methods  Balances latency, throughput, fault-tolerance, big data, real-time analytics, mitigates the latencies of map-reduce  Data model with an append-only, immutable data source that serves as a system of record  Ingesting and processing timestamped events that are appended to existing events. State is determined from the natural time-based ordering of the data.
  • 12. Druid Distributed Data Store (Java) 12 https://commons.wikimedia.org/w/index.php?curid=33899448 By Fangjin Yang - sent to me personally, GFDL Apache ZooKeeper MySQL / PostgreSQL HDFS / Amazon S3
  • 13. Lambda Architecture: Projects - I 13  Apache Spark is an open-source cluster-computing framework. Spark Streaming, Spark Mllib  Apache Storm is a distributed stream processing – streams DAG  Apache Apex™ unified stream and batch processing engine.
  • 14. Lambda Architecture: Projects - II  Apache Flink - open source stream processing framework – Java, Scala  Apache Kafka - open-source stream processing (Kafka Streams), real- time, low-latency, high-throughput, massively scalable pub/sub  Apache Beam – unified batch and streaming, portable, extensible
  • 16. Synchronous vs. Asynchronous IO 16 DB Synchronous A A B B DB Asynchronous A B C D A B C D
  • 17. Example: Internet of Things (IoT) 17 CC BY 2.0, Source: https://www.flickr.com/photos/wilgengebroed/8249565455/ Radar, GPS, lidar for navigation and obstacle avoidance ( 2007 DARPA Urban Challenge )
  • 18. IoT Services Architecture 18 Devices: Hardware + Embedded Software + Firmware UART/ I2C/ 2G/ 3G/ LTE/ ZigBee/ 6LowPan/ BLE Aggregation/ Bus: ESB, Message Broker Device Gateway: Local Coordination and Event Aggregation M2M: HTTP(/2) / WS / MQTT / CoAP Management: TR-069 / OMA-DM / OMA LWM2M HTTP, AMQP Cloud (Micro)Service Mng. Docker, Kubernetes/ Apache Brooklyn Web/ Mobile Portal PaaSDashboard PaaS API: Event Processing Services, Analytics
  • 19. 19  Performance is about 2 things (Martin Thompson – http://www.infoq.com/articles/low-latency-vp ): – Throughput – units per second, and – Latency – response time  Real-time – time constraint from input to response regardless of system load.  Hard real-time system if this constraint is not honored then a total system failure can occur.  Soft real-time system – low latency response with little deviation in response time  100 nano-seconds to 100 milli-seconds. [Peter Lawrey] What's High Performance?
  • 20. 20  Low garbage by reusing existing objects + infrequent GC when application not busy – can improve app 2 - 5x  JVM generational GC startegy – ideal for objects living very shortly (garbage collected next minor sweep) or be immortal  Non-blocking, lockless coding or CAS  Critical data structures – direct memory access using DirectByteBuffers or Unsafe => predictable memory layout and cache misses avoidance  Busy waiting – giving the CPU to OS kernel slows program 2-5x => avoid context switches  Amortize the effect of expensive IO - blocking Low Latency: Things to Remember
  • 21. Tracking Complexity 21 We need tools to cope with all that complexity Simple solutions are needed – cope with problems through divide and concur on different levels of abstraction: Domain Driven Design (DDD) – back to basics: domain objects, data and logic. Described by Eric Evans in his book: Domain Driven Design: Tackling Complexity in the Heart of Software, 2004
  • 22. Domain Driven Design 22 Main concepts:  Entities, value objects and modules  Aggregates and Aggregate Roots [Haywood]: value < entity < aggregate < module < BC  Aggregate Roots are exposed as Open Host Services  Repositories, Factories and Services: application services <-> domain services  Separating interface from implementation
  • 23. Microservices and DDD 23 Actually DDD require additional efforts (as most other divide and concur modeling approaches :)  Ubiquitous language and Bounded Contexts  Hexagonal architecture : OUTSIDE <-> transformer <-> ( application <-> domain )
  • 24. Imperative and Reactive 24 We live in a Connected Universe ... there is hypothesis that all the things in the Universe are intimately connected, and you can not change a bit without changing all. Action – Reaction principle is the essence of how Universe behaves.
  • 25. Imperative and Reactive  Reactive Programming: using static or dynamic data flows and propagation of change Example: a := b + c  Functional Programming: evaluation of mathematical functions, ➢ Avoids changing-state and mutable data, declarative programming ➢ Side effects free => much easier to understand and predict the program behavior. Example: books.stream().filter(book -> book.getYear() > 2010) .forEach( System.out::println )
  • 26. Functional Reactive (FRP) 26 According to Connal Elliot's (ground-breaking paper @ Conference on Functional Programming, 1997), FRP is: (a) Denotative (b) Temporally continuous
  • 28. 28  Message Driven – asynchronous message-passing allows to establish a boundary between components that ensures loose coupling, isolation, location transparency, and provides the means to delegate errors as messages [Reactive Manifesto].  The main idea is to separate concurrent producer and consumer workers by using message queues.  Message queues can be unbounded or bounded (limited max number of messages)  Unbounded message queues can present memory allocation problem in case the producers outrun the consumers for a long period → OutOfMemoryError Scalable, Massively Concurrent
  • 29. Reactive Programming 29  Microsoft® opens source polyglot project ReactiveX (Reactive Extensions) [http://reactivex.io]: Rx = Observables + LINQ + Schedulers :) Java: RxJava, JavaScript: RxJS, C#: Rx.NET, Scala: RxScala, Clojure: RxClojure, C++: RxCpp, Ruby: Rx.rb, Python: RxPY, Groovy: RxGroovy, JRuby: RxJRuby, Kotlin: RxKotlin ...  Reactive Streams Specification [http://www.reactive-streams.org/] used by:  (Spring) Project Reactor [http://projectreactor.io/]  Actor Model – Akka (Java, Scala) [http://akka.io/]
  • 30. Reactive Streams Spec. 30  Reactive Streams – provides standard for asynchronous stream processing with non-blocking back pressure.  Minimal set of interfaces, methods and protocols for asynchronous data streams  April 30, 2015: has been released version 1.0.0 of Reactive Streams for the JVM (Java API, Specification, TCK and implementation examples)  Java 9: java.util.concurrent.Flow
  • 31. Reactive Streams Spec. 31  Publisher – provider of potentially unbounded number of sequenced elements, according to Subscriber(s) demand. Publisher.subscribe(Subscriber) => onSubscribe onNext* (onError | onComplete)?  Subscriber – calls Subscription.request(long) to receive notifications  Subscription – one-to-one Subscriber ↔ Publisher, request data and cancel demand (allow cleanup).  Processor = Subscriber + Publisher
  • 32. FRP = Async Data Streams 32  FRP is asynchronous data-flow programming using the building blocks of functional programming (e.g. map, reduce, filter) and explicitly modeling time  Used for GUIs, robotics, and music. Example (RxJava): Observable.from( new String[]{"Reactive", "Extensions", "Java"}) .take(2).map(s -> s + " : on " + new Date()) .subscribe(s -> System.out.println(s)); Result: Reactive : on Wed Jun 17 21:54:02 GMT+02:00 2015 Extensions : on Wed Jun 17 21:54:02 GMT+02:00 2015
  • 33. Project Reactor 33  Reactor project allows building high-performance (low latency high throughput) non-blocking asynchronous applications on JVM.  Reactor is designed to be extraordinarily fast and can sustain throughput rates on order of 10's of millions of operations per second.  Reactor has powerful API for declaring data transformations and functional composition.  Makes use of the concept of Mechanical Sympathy built on top of Disruptor / RingBuffer.
  • 34. Reactor Projects 34 https://github.com/reactor/reactor, Apache Software License 2.0 IPC – Netty, Kafka, Aeron
  • 37. Flux & Redux Design Patterns Source: Flux in GitHub, https://github.com/facebook/flux, License: BSD 3-clause "New" License
  • 38. Source: RxJava 2 API documentation, http://reactivex.io/RxJava/2.x/javadoc/ Redux == Rx Scan Opearator
  • 39. Hot and Cold Event Streams 39  PULL-based (Cold Event Streams) – Cold streams (e.g. RxJava Observable / Flowable or Reactor Flow / Mono) are streams that run their sequence when and if they are subscribed to. They present the sequence from the start to each subscriber.  PUSH-based (Hot Event Streams) – emit values independent of individual subscriptions. They have their own timeline and events occur whether someone is listening or not. When subscription is made observer receives current events as they happen. Example: mouse events
  • 40. Converting Cold to Hot Stream 40
  • 41. Hot Stream Example - Reactor 41 EmitterProcessor<String> emitter = EmitterProcessor.create(); FluxSink<String> sink = emitter.sink(); emitter.publishOn(Schedulers.single()) .map(String::toUpperCase) .filter(s -> s.startsWith("HELLO")) .delayElements(Duration.of(1000, MILLIS)) .subscribe(System.out::println); sink.next("Hello World!"); // emit - non blocking sink.next("Goodbye World!"); sink.next("Hello Trayan!"); Thread.sleep(3000);
  • 42. Top New Features in Spring 5 42  Reactive Programming Model  Spring Web Flux  Reactive DB repositories & integrations + hot event streaming: MongoDB, Redis, Cassandra, Kafka  JDK 8+ and Java EE 7+ baseline  Testing improvements  Kotlin functional DSL
  • 43. Project Reactor Spring 5 Main Building Blocks 43Source: https://spring.io Spring Boot 2.0 Reactive Stack (async IO) Servlet Stack (one request per thread) Spring Security Reactive Every JEE Servlet Container (tomact, jetty, undertow, ...) Nonblocking NIO Runtimes (Netty, Servlet 3.1 Containers) Spring Security Spring MVC Spring WebFlux Spring Data Repositories JDBC, JPA, NoSQL Spring Data Reactive Repositories Mongo, Cassandra, Redis, Couchbase
  • 44. Multi-Threading 44 Reactor Threads Java Native Thread Pool (for blocking operations) Threads
  • 45. WebFlux: Best Expalined in Code 45 Lets see REST service Spring 5 WebFlux demos. Available @GitHub: https://github.com/iproduct/spring-5-webflux
  • 46. Thank’s for Your Attention! 46 Trayan Iliev CEO of IPT – Intellectual Products & Technologies http://iproduct.org/ http://robolearn.org/ https://github.com/iproduct https://twitter.com/trayaniliev https://www.facebook.com/IPT.EACAD https://plus.google.com/+IproductOrg