SlideShare una empresa de Scribd logo
1 de 42
Reactive Streams
Beyond the manifesto
László van den Hoek
• Will code for food since 2008
• Rubix/Lightbend partnership instigator
• Currently @ KLPD 👮🏻 building a data platform
Non-blocking processing with event loops
Non-blocking processing with event loops
Fast producer, slow consumer
OutOfMemoryError
Use cases for managing control flow
• Upstream supply exceeds downstream capacity
• …constantly, but cannot scale downstream
• …occasionally; bursty source.
• Messages need to be processed in-order
• Partitioning and sharding may help, but maybe not enough
• Efficient use of resources
• Provision for what you need, not for what you (could) get
• Concrete example: sensor data
Reactive Streams
• Available since 2013; latest version: 1.0.2 (19-12-2017)
• “asynchronous streams of data with non-blocking back pressure”
• a.k.a. async pull-push flow control
• 4 interfaces, 7 methods, 43 rules for implementors:
• Publisher<T>
• subscribe(Subscriber<? super T> s)
• Subscriber<T>
• onSubscribe(Subscription s), onNext(T t), onError(Throwable t), onComplete()
• Subscription
• request(long n), cancel()
• Processor<T,R> extends Subscriber<T>, Publisher<R>
• Included in Java SE since JDK9 through JEP-266 as java.util.concurrent.Flow.*
• Different implementations can be connected and converted
request(n) request(n)
onNext(t) onNext(t)
Source stream
(Publisher)
Explicit demand model propagates backpressure
Store
(Subscriber)
Processor
Message flow
request(1)
Store
(Subscriber)
request(n)
onNext(t) onNext(t)
Source stream
(Publisher)
Dealing with unbackpressured upstream
Processor
Message flow
DROPDROP
Akka – a JVM implementation of the actor model
• Actors can:
• receive messages
• asynchronously send messages to other actors
• create and supervise child actors
• change their own internal state while processing a message
• When an actor encounters a problem, it will notify its parent, who can either:
• Resume
• Restart
• Stop
• Escalate
History of the Actor model
• Proposed in 1973 by Carl Hewitt
• Implemented in Erlang in 1980’s
– 99.9999999% (!) uptime in telco setting
• Implemented in Scala in 2006
– Had problems
• Akka: separate project started in 2009
– Scala and Java API’s
– Replaced Scala implementation in 2012
– Java API is fully supported and up to date
So what does an actor do?
• Receive messages
• Send messages to any actor address
• Create and supervise child actors
• Change the way it will process the next message
Why is this a good abstraction?
• Explicit about unreliability and handling it
– A slow actor is a dead actor
• Communicate solely by message passing
– eliminates shared state bottleneck
• Scale up for “free*”
– Immutability means parallellizability
Example Actor System
/user/rest
/user/rest/process
/user/rest/process/persist
/user/rest/process/retrieve
Supervision (a.k.a. Let It Crash)
• Resume
– catch(Exception e) {}
Resume
/user/rest
/user/rest/process
/user/rest/process/persist
/user/rest/process/retrieve
Supervision (a.k.a. Let It Crash)
• Resume
– catch(Exception e) {}
• Restart
– this = new Child()
Example Actor System
/user/rest
/user/rest/process
/user/rest/process/persist
/user/rest/process/retrieve
Supervision (a.k.a. Let It Crash)
• Resume
– catch(Exception e) {}
• Restart
– this = new Child()
• Stop
– Parent ! Terminated
Stop
/user/rest
/user/rest/process
/user/rest/process/persist
/user/rest/process/retrieve
Supervision (a.k.a. Let It Crash)
• Resume
– catch(Exception e) {}
• Restart
– this = new Child()
• Stop
– Parent ! Terminated
• Escalate
– throw(e)
Example Actor System
/user/rest
/user/rest/process
/user/rest/process/persist
/user/rest/process/retrieve
Akka-specific features
• On top of the actor model, Akka provides:
– Ordered message arrival
– Scaling out with location transparency
– Tool box with high-level components
• Circuit breaker
Akka-specific features
• On top of the actor model, Akka provides:
– Ordered message arrival
– Scaling out with location transparency
– Tool box with high-level components
• Circuit breaker
Ordered message arrival
• actor.send(m1)
• actor.send(m2)
• In receive() method of actor, you will
never get m2 before m1
actoranyone
m1
m2
Doesn’t hold transitively
• actor1.send(m1)
• actor2.send(m2)
• In receive() method of actor1:
– actor2.forward(m1)
actor1
anyone
m1
m2
actor2
m1
No way to tell
what actor2 will see
Akka-specific features
• On top of the actor model, Akka provides:
– Ordered message arrival
– Scaling out with location transparency
– Tool box with high-level components
• Circuit breaker
Location transparency
VM 1
VM 2 VM 3
Akka-specific features
• On top of the actor model, Akka provides:
– Ordered message arrival
– Scaling out with location transparency
– Tool box with high-level components
• Circuit breaker
Circuit breaker
/user/rest
/user/rest/process
/user/rest/process/persist
/user/rest/process/retrieve
Delegate “risky” tasks (e.g. calls over network)
Akka Streams implements Reactive Streams
Publisher Processor Subscriber
Source Flow Sink
implements implements implements
Akka Streams code example: split/aggregate
CompletionStage<List<Integer>> ret =
Source.from(Arrays.asList("1-2-3", "2-3", "3-4"))
.map(s -> Arrays.asList(s.split("-")))
//split all messages into sub-streams
.splitWhen(a -> true)
//now split each collection
.mapConcat(f -> f)
//Sub-streams logic
.map(s -> Integer.valueOf(s))
//aggregate each sub-stream
.reduce((a, b) -> a + b)
//and merge back the result into the original stream
.mergeSubstreams()
.runWith(Sink.seq(), materializer);
//result: List(6, 5, 7)
Akka HTTP
• Built on top of Akka Streams
• HTTP requests and responses are represented with Akka Streams types:
• Requests as Source<HttpRequest, ?>
• Responses as Sink<HttpResponse, ?>
• Message bodies as Source<ByteString, ?>
Reactive Enterprise Integration using Akka
• System integration in a nutshell:
• Input
• Transform
• Output
• Camel lets you define these separately, but no native streaming support
• RxJava lets you define streams, but not in a reusable way
• Akka Streams lets you define reusable, reactive components
• Akka HTTP is an async HTTP client built on top of Akka Streams
• Alpakka provides a set of backpressure-aware components…
Alpaca?
val jmsSource: Source[String, KillSwitch] =
JmsConsumer.textSource( // (1)
JmsConsumerSettings(connectionFactory).withBufferSize(10).withQueue("test")
)
val webSocketFlow: Flow[ws.Message, ws.Message, Future[WebSocketUpgradeResponse]] = // (2)
Http().webSocketClientFlow(WebSocketRequest("ws://localhost:8080/webSocket/ping"))
val (runningSource, wsUpgradeResponse): (KillSwitch, Future[WebSocketUpgradeResponse]) =
// stream element type
jmsSource //: String
.map(ws.TextMessage(_)) //: ws.TextMessage (3)
.viaMat(webSocketFlow)(Keep.both) //: ws.TextMessage (4)
.mapAsync(1)(wsMessageToString) //: String (5)
.map("client received: " + _) //: String (6)
.toMat(Sink.foreach(println))(Keep.left) // (7)
.run()
Alpakka connectors
• AMQP Connector
• Apache Geode
connector
• Apache Solr
Connector
• AWS DynamoDB
Connector
• AWS Kinesis
Connector
• AWS Lambda
Connector
• AWS S3 Connector
• AWS SNS Connector
• AWS SQS Connector
• MongoDB Connector
• MQTT Connector
• OrientDB Connector
• Server-sent Events
(SSE) Connector
• Slick (JDBC)
Connector
• Spring Web
• Unix Domain Socket
Connector
• File IO
• Azure Storage Queue
Connector
• Cassandra Connector
• Elasticsearch
Connector
• File Connectors
• FTP Connector
• Google Cloud Pub/Sub
• Google Firebase Cloud
Messaging
• HBase connector
• IronMq Connector
• JMS Connector
• Azure
• AWS Kinesis
• Camel
• Eventuate
• FS2
• HTTP Client
• MongoDB
• Kafka
• Pulsar
• TCP
Akka
Actors
Akka Streams
Akka HTTP
Alpakka
Reactive
Streams
Vert.X : Akka
≡
Containers : λ
RxJava is backwards compatible
• Android does not fully support Java 8; support for java.util.function.* only since Android 7.0
• RxJava (including 2.x) targets Android 2.3+  JDK 6
• Own set of interfaces to support FP
• Extra adapter classes needed for Reactive Streams
Links
• Konrad Malawski - Why Reactive? http://www.oreilly.com/programming/free/files/why-reactive.pdf

Más contenido relacionado

La actualidad más candente

Akka and Kubernetes: Reactive From Code To Cloud
Akka and Kubernetes: Reactive From Code To CloudAkka and Kubernetes: Reactive From Code To Cloud
Akka and Kubernetes: Reactive From Code To CloudLightbend
 
Non-blocking IO to tame distributed systems ー How and why ChatWork uses async...
Non-blocking IO to tame distributed systems ー How and why ChatWork uses async...Non-blocking IO to tame distributed systems ー How and why ChatWork uses async...
Non-blocking IO to tame distributed systems ー How and why ChatWork uses async...TanUkkii
 
What’s expected in Spring 5
What’s expected in Spring 5What’s expected in Spring 5
What’s expected in Spring 5Gal Marder
 
Akka A to Z: A Guide To The Industry’s Best Toolkit for Fast Data and Microse...
Akka A to Z: A Guide To The Industry’s Best Toolkit for Fast Data and Microse...Akka A to Z: A Guide To The Industry’s Best Toolkit for Fast Data and Microse...
Akka A to Z: A Guide To The Industry’s Best Toolkit for Fast Data and Microse...Lightbend
 
Building Eventing Systems for Microservice Architecture
Building Eventing Systems for Microservice Architecture  Building Eventing Systems for Microservice Architecture
Building Eventing Systems for Microservice Architecture Yaroslav Tkachenko
 
Designing for Distributed Systems with Reactor and Reactive Streams
Designing for Distributed Systems with Reactor and Reactive StreamsDesigning for Distributed Systems with Reactor and Reactive Streams
Designing for Distributed Systems with Reactor and Reactive StreamsStéphane Maldini
 
Bootstrapping Microservices with Kafka, Akka and Spark
Bootstrapping Microservices with Kafka, Akka and SparkBootstrapping Microservices with Kafka, Akka and Spark
Bootstrapping Microservices with Kafka, Akka and SparkAlex Silva
 
Event Driven Architectures with Camel
Event Driven Architectures with CamelEvent Driven Architectures with Camel
Event Driven Architectures with Camelgnanagurus
 
Kafkaesque days at linked in in 2015
Kafkaesque days at linked in in 2015Kafkaesque days at linked in in 2015
Kafkaesque days at linked in in 2015Joel Koshy
 
Reactive Design Patterns: a talk by Typesafe's Dr. Roland Kuhn
Reactive Design Patterns: a talk by Typesafe's Dr. Roland KuhnReactive Design Patterns: a talk by Typesafe's Dr. Roland Kuhn
Reactive Design Patterns: a talk by Typesafe's Dr. Roland KuhnZalando Technology
 
A Journey to Reactive Function Programming
A Journey to Reactive Function ProgrammingA Journey to Reactive Function Programming
A Journey to Reactive Function ProgrammingAhmed Soliman
 
Streaming Design Patterns Using Alpakka Kafka Connector (Sean Glover, Lightbe...
Streaming Design Patterns Using Alpakka Kafka Connector (Sean Glover, Lightbe...Streaming Design Patterns Using Alpakka Kafka Connector (Sean Glover, Lightbe...
Streaming Design Patterns Using Alpakka Kafka Connector (Sean Glover, Lightbe...confluent
 
Architecture of Falcon, a new chat messaging backend system build on Scala
Architecture of Falcon,  a new chat messaging backend system  build on ScalaArchitecture of Falcon,  a new chat messaging backend system  build on Scala
Architecture of Falcon, a new chat messaging backend system build on ScalaTanUkkii
 
Why Actor-Based Systems Are The Best For Microservices
Why Actor-Based Systems Are The Best For MicroservicesWhy Actor-Based Systems Are The Best For Microservices
Why Actor-Based Systems Are The Best For MicroservicesYaroslav Tkachenko
 
Running large scale Kafka upgrades at Yelp (Manpreet Singh,Yelp) Kafka Summit...
Running large scale Kafka upgrades at Yelp (Manpreet Singh,Yelp) Kafka Summit...Running large scale Kafka upgrades at Yelp (Manpreet Singh,Yelp) Kafka Summit...
Running large scale Kafka upgrades at Yelp (Manpreet Singh,Yelp) Kafka Summit...confluent
 
Introducing Exactly Once Semantics To Apache Kafka
Introducing Exactly Once Semantics To Apache KafkaIntroducing Exactly Once Semantics To Apache Kafka
Introducing Exactly Once Semantics To Apache KafkaApurva Mehta
 
8th Athens Big Data Meetup - 1st Talk - Riding The Streaming Wave DIY Style
8th Athens Big Data Meetup - 1st Talk - Riding The Streaming Wave DIY Style8th Athens Big Data Meetup - 1st Talk - Riding The Streaming Wave DIY Style
8th Athens Big Data Meetup - 1st Talk - Riding The Streaming Wave DIY StyleAthens Big Data
 
Making Scala Faster: 3 Expert Tips For Busy Development Teams
Making Scala Faster: 3 Expert Tips For Busy Development TeamsMaking Scala Faster: 3 Expert Tips For Busy Development Teams
Making Scala Faster: 3 Expert Tips For Busy Development TeamsLightbend
 

La actualidad más candente (20)

Akka and Kubernetes: Reactive From Code To Cloud
Akka and Kubernetes: Reactive From Code To CloudAkka and Kubernetes: Reactive From Code To Cloud
Akka and Kubernetes: Reactive From Code To Cloud
 
Non-blocking IO to tame distributed systems ー How and why ChatWork uses async...
Non-blocking IO to tame distributed systems ー How and why ChatWork uses async...Non-blocking IO to tame distributed systems ー How and why ChatWork uses async...
Non-blocking IO to tame distributed systems ー How and why ChatWork uses async...
 
What’s expected in Spring 5
What’s expected in Spring 5What’s expected in Spring 5
What’s expected in Spring 5
 
Akka A to Z: A Guide To The Industry’s Best Toolkit for Fast Data and Microse...
Akka A to Z: A Guide To The Industry’s Best Toolkit for Fast Data and Microse...Akka A to Z: A Guide To The Industry’s Best Toolkit for Fast Data and Microse...
Akka A to Z: A Guide To The Industry’s Best Toolkit for Fast Data and Microse...
 
Building Eventing Systems for Microservice Architecture
Building Eventing Systems for Microservice Architecture  Building Eventing Systems for Microservice Architecture
Building Eventing Systems for Microservice Architecture
 
Designing for Distributed Systems with Reactor and Reactive Streams
Designing for Distributed Systems with Reactor and Reactive StreamsDesigning for Distributed Systems with Reactor and Reactive Streams
Designing for Distributed Systems with Reactor and Reactive Streams
 
Bootstrapping Microservices with Kafka, Akka and Spark
Bootstrapping Microservices with Kafka, Akka and SparkBootstrapping Microservices with Kafka, Akka and Spark
Bootstrapping Microservices with Kafka, Akka and Spark
 
Event Driven Architectures with Camel
Event Driven Architectures with CamelEvent Driven Architectures with Camel
Event Driven Architectures with Camel
 
Kafkaesque days at linked in in 2015
Kafkaesque days at linked in in 2015Kafkaesque days at linked in in 2015
Kafkaesque days at linked in in 2015
 
Reactive Design Patterns: a talk by Typesafe's Dr. Roland Kuhn
Reactive Design Patterns: a talk by Typesafe's Dr. Roland KuhnReactive Design Patterns: a talk by Typesafe's Dr. Roland Kuhn
Reactive Design Patterns: a talk by Typesafe's Dr. Roland Kuhn
 
Time Machine
Time MachineTime Machine
Time Machine
 
A Journey to Reactive Function Programming
A Journey to Reactive Function ProgrammingA Journey to Reactive Function Programming
A Journey to Reactive Function Programming
 
Streaming Design Patterns Using Alpakka Kafka Connector (Sean Glover, Lightbe...
Streaming Design Patterns Using Alpakka Kafka Connector (Sean Glover, Lightbe...Streaming Design Patterns Using Alpakka Kafka Connector (Sean Glover, Lightbe...
Streaming Design Patterns Using Alpakka Kafka Connector (Sean Glover, Lightbe...
 
Architecture of Falcon, a new chat messaging backend system build on Scala
Architecture of Falcon,  a new chat messaging backend system  build on ScalaArchitecture of Falcon,  a new chat messaging backend system  build on Scala
Architecture of Falcon, a new chat messaging backend system build on Scala
 
Kafka reliability velocity 17
Kafka reliability   velocity 17Kafka reliability   velocity 17
Kafka reliability velocity 17
 
Why Actor-Based Systems Are The Best For Microservices
Why Actor-Based Systems Are The Best For MicroservicesWhy Actor-Based Systems Are The Best For Microservices
Why Actor-Based Systems Are The Best For Microservices
 
Running large scale Kafka upgrades at Yelp (Manpreet Singh,Yelp) Kafka Summit...
Running large scale Kafka upgrades at Yelp (Manpreet Singh,Yelp) Kafka Summit...Running large scale Kafka upgrades at Yelp (Manpreet Singh,Yelp) Kafka Summit...
Running large scale Kafka upgrades at Yelp (Manpreet Singh,Yelp) Kafka Summit...
 
Introducing Exactly Once Semantics To Apache Kafka
Introducing Exactly Once Semantics To Apache KafkaIntroducing Exactly Once Semantics To Apache Kafka
Introducing Exactly Once Semantics To Apache Kafka
 
8th Athens Big Data Meetup - 1st Talk - Riding The Streaming Wave DIY Style
8th Athens Big Data Meetup - 1st Talk - Riding The Streaming Wave DIY Style8th Athens Big Data Meetup - 1st Talk - Riding The Streaming Wave DIY Style
8th Athens Big Data Meetup - 1st Talk - Riding The Streaming Wave DIY Style
 
Making Scala Faster: 3 Expert Tips For Busy Development Teams
Making Scala Faster: 3 Expert Tips For Busy Development TeamsMaking Scala Faster: 3 Expert Tips For Busy Development Teams
Making Scala Faster: 3 Expert Tips For Busy Development Teams
 

Similar a Beyond the Manifesto: Reactive Streams with Akka and Alpakka

Akka in Production - ScalaDays 2015
Akka in Production - ScalaDays 2015Akka in Production - ScalaDays 2015
Akka in Production - ScalaDays 2015Evan Chan
 
Journey into Reactive Streams and Akka Streams
Journey into Reactive Streams and Akka StreamsJourney into Reactive Streams and Akka Streams
Journey into Reactive Streams and Akka StreamsKevin Webber
 
Building a Reactive System with Akka - Workshop @ O'Reilly SAConf NYC
Building a Reactive System with Akka - Workshop @ O'Reilly SAConf NYCBuilding a Reactive System with Akka - Workshop @ O'Reilly SAConf NYC
Building a Reactive System with Akka - Workshop @ O'Reilly SAConf NYCKonrad Malawski
 
Build Real-Time Streaming ETL Pipelines With Akka Streams, Alpakka And Apache...
Build Real-Time Streaming ETL Pipelines With Akka Streams, Alpakka And Apache...Build Real-Time Streaming ETL Pipelines With Akka Streams, Alpakka And Apache...
Build Real-Time Streaming ETL Pipelines With Akka Streams, Alpakka And Apache...Lightbend
 
Actor model in .NET - Akka.NET
Actor model in .NET - Akka.NETActor model in .NET - Akka.NET
Actor model in .NET - Akka.NETKonrad Dusza
 
Agile Lab_BigData_Meetup_AKKA
Agile Lab_BigData_Meetup_AKKAAgile Lab_BigData_Meetup_AKKA
Agile Lab_BigData_Meetup_AKKAPaolo Platter
 
Reactive Stream Processing with Akka Streams
Reactive Stream Processing with Akka StreamsReactive Stream Processing with Akka Streams
Reactive Stream Processing with Akka StreamsKonrad Malawski
 
Reactive Streams 1.0 and Akka Streams
Reactive Streams 1.0 and Akka StreamsReactive Streams 1.0 and Akka Streams
Reactive Streams 1.0 and Akka StreamsDean Wampler
 
Real world Scala hAkking NLJUG JFall 2011
Real world Scala hAkking NLJUG JFall 2011Real world Scala hAkking NLJUG JFall 2011
Real world Scala hAkking NLJUG JFall 2011Raymond Roestenburg
 
Developing distributed applications with Akka and Akka Cluster
Developing distributed applications with Akka and Akka ClusterDeveloping distributed applications with Akka and Akka Cluster
Developing distributed applications with Akka and Akka ClusterKonstantin Tsykulenko
 
Springone2gx 2014 Reactive Streams and Reactor
Springone2gx 2014 Reactive Streams and ReactorSpringone2gx 2014 Reactive Streams and Reactor
Springone2gx 2014 Reactive Streams and ReactorStéphane Maldini
 
Akka Microservices Architecture And Design
Akka Microservices Architecture And DesignAkka Microservices Architecture And Design
Akka Microservices Architecture And DesignYaroslav Tkachenko
 
Reactive programming with examples
Reactive programming with examplesReactive programming with examples
Reactive programming with examplesPeter Lawrey
 
DotNext 2020 - When and How to Use the Actor Model and Akka.NET
DotNext 2020 - When and How to Use the Actor Model and Akka.NETDotNext 2020 - When and How to Use the Actor Model and Akka.NET
DotNext 2020 - When and How to Use the Actor Model and Akka.NETpetabridge
 
Streaming and Messaging
Streaming and MessagingStreaming and Messaging
Streaming and MessagingXin Wang
 
Introduction to Actor Model and Akka
Introduction to Actor Model and AkkaIntroduction to Actor Model and Akka
Introduction to Actor Model and AkkaYung-Lin Ho
 
Introduction to Actor Model and Akka
Introduction to Actor Model and AkkaIntroduction to Actor Model and Akka
Introduction to Actor Model and AkkaYung-Lin Ho
 
Apache Kafka
Apache KafkaApache Kafka
Apache KafkaJoe Stein
 
Lessons Learned From PayPal: Implementing Back-Pressure With Akka Streams And...
Lessons Learned From PayPal: Implementing Back-Pressure With Akka Streams And...Lessons Learned From PayPal: Implementing Back-Pressure With Akka Streams And...
Lessons Learned From PayPal: Implementing Back-Pressure With Akka Streams And...Lightbend
 

Similar a Beyond the Manifesto: Reactive Streams with Akka and Alpakka (20)

Akka in Production - ScalaDays 2015
Akka in Production - ScalaDays 2015Akka in Production - ScalaDays 2015
Akka in Production - ScalaDays 2015
 
Journey into Reactive Streams and Akka Streams
Journey into Reactive Streams and Akka StreamsJourney into Reactive Streams and Akka Streams
Journey into Reactive Streams and Akka Streams
 
Building a Reactive System with Akka - Workshop @ O'Reilly SAConf NYC
Building a Reactive System with Akka - Workshop @ O'Reilly SAConf NYCBuilding a Reactive System with Akka - Workshop @ O'Reilly SAConf NYC
Building a Reactive System with Akka - Workshop @ O'Reilly SAConf NYC
 
Build Real-Time Streaming ETL Pipelines With Akka Streams, Alpakka And Apache...
Build Real-Time Streaming ETL Pipelines With Akka Streams, Alpakka And Apache...Build Real-Time Streaming ETL Pipelines With Akka Streams, Alpakka And Apache...
Build Real-Time Streaming ETL Pipelines With Akka Streams, Alpakka And Apache...
 
Actor model in .NET - Akka.NET
Actor model in .NET - Akka.NETActor model in .NET - Akka.NET
Actor model in .NET - Akka.NET
 
Agile Lab_BigData_Meetup_AKKA
Agile Lab_BigData_Meetup_AKKAAgile Lab_BigData_Meetup_AKKA
Agile Lab_BigData_Meetup_AKKA
 
Reactive Stream Processing with Akka Streams
Reactive Stream Processing with Akka StreamsReactive Stream Processing with Akka Streams
Reactive Stream Processing with Akka Streams
 
Reactive Streams 1.0 and Akka Streams
Reactive Streams 1.0 and Akka StreamsReactive Streams 1.0 and Akka Streams
Reactive Streams 1.0 and Akka Streams
 
Real world Scala hAkking NLJUG JFall 2011
Real world Scala hAkking NLJUG JFall 2011Real world Scala hAkking NLJUG JFall 2011
Real world Scala hAkking NLJUG JFall 2011
 
Developing distributed applications with Akka and Akka Cluster
Developing distributed applications with Akka and Akka ClusterDeveloping distributed applications with Akka and Akka Cluster
Developing distributed applications with Akka and Akka Cluster
 
Springone2gx 2014 Reactive Streams and Reactor
Springone2gx 2014 Reactive Streams and ReactorSpringone2gx 2014 Reactive Streams and Reactor
Springone2gx 2014 Reactive Streams and Reactor
 
Akka Microservices Architecture And Design
Akka Microservices Architecture And DesignAkka Microservices Architecture And Design
Akka Microservices Architecture And Design
 
Reactive programming with examples
Reactive programming with examplesReactive programming with examples
Reactive programming with examples
 
DotNext 2020 - When and How to Use the Actor Model and Akka.NET
DotNext 2020 - When and How to Use the Actor Model and Akka.NETDotNext 2020 - When and How to Use the Actor Model and Akka.NET
DotNext 2020 - When and How to Use the Actor Model and Akka.NET
 
Akka.Net Overview
Akka.Net OverviewAkka.Net Overview
Akka.Net Overview
 
Streaming and Messaging
Streaming and MessagingStreaming and Messaging
Streaming and Messaging
 
Introduction to Actor Model and Akka
Introduction to Actor Model and AkkaIntroduction to Actor Model and Akka
Introduction to Actor Model and Akka
 
Introduction to Actor Model and Akka
Introduction to Actor Model and AkkaIntroduction to Actor Model and Akka
Introduction to Actor Model and Akka
 
Apache Kafka
Apache KafkaApache Kafka
Apache Kafka
 
Lessons Learned From PayPal: Implementing Back-Pressure With Akka Streams And...
Lessons Learned From PayPal: Implementing Back-Pressure With Akka Streams And...Lessons Learned From PayPal: Implementing Back-Pressure With Akka Streams And...
Lessons Learned From PayPal: Implementing Back-Pressure With Akka Streams And...
 

Más de RubiX BV

Reactive programming - Dirk Janssen (presentation 13th SPIN Meetup)
Reactive programming - Dirk Janssen (presentation 13th SPIN Meetup)Reactive programming - Dirk Janssen (presentation 13th SPIN Meetup)
Reactive programming - Dirk Janssen (presentation 13th SPIN Meetup)RubiX BV
 
Meetup hip 18 april 2017
Meetup hip 18 april 2017Meetup hip 18 april 2017
Meetup hip 18 april 2017RubiX BV
 
Rubix - Serverless architecture
Rubix - Serverless architectureRubix - Serverless architecture
Rubix - Serverless architectureRubiX BV
 
Crowd Designing Microservices Architecture
Crowd Designing Microservices ArchitectureCrowd Designing Microservices Architecture
Crowd Designing Microservices ArchitectureRubiX BV
 
Microservices - an integration perspective
Microservices - an integration perspectiveMicroservices - an integration perspective
Microservices - an integration perspectiveRubiX BV
 
RubiX ID - Big Data - Ruben Middeljans, Stephan Vos
RubiX ID - Big Data - Ruben Middeljans, Stephan VosRubiX ID - Big Data - Ruben Middeljans, Stephan Vos
RubiX ID - Big Data - Ruben Middeljans, Stephan VosRubiX BV
 
RubiX ID - Continuous Integration & Continuous Delivery - Roel van den Berg, ...
RubiX ID - Continuous Integration & Continuous Delivery - Roel van den Berg, ...RubiX ID - Continuous Integration & Continuous Delivery - Roel van den Berg, ...
RubiX ID - Continuous Integration & Continuous Delivery - Roel van den Berg, ...RubiX BV
 
RubiX ID - SOA Governance - Wouter de Vries
RubiX ID - SOA Governance - Wouter de VriesRubiX ID - SOA Governance - Wouter de Vries
RubiX ID - SOA Governance - Wouter de VriesRubiX BV
 
RubiX ID - SOA Security - Ingrid Cox
RubiX ID - SOA Security - Ingrid CoxRubiX ID - SOA Security - Ingrid Cox
RubiX ID - SOA Security - Ingrid CoxRubiX BV
 
RubiX ID - Tibco business works™ 6 in de praktijk - Bart de Koning en Marcel ...
RubiX ID - Tibco business works™ 6 in de praktijk - Bart de Koning en Marcel ...RubiX ID - Tibco business works™ 6 in de praktijk - Bart de Koning en Marcel ...
RubiX ID - Tibco business works™ 6 in de praktijk - Bart de Koning en Marcel ...RubiX BV
 
RubiX ID - API management - Pim Gaemers
RubiX ID - API management - Pim GaemersRubiX ID - API management - Pim Gaemers
RubiX ID - API management - Pim GaemersRubiX BV
 

Más de RubiX BV (11)

Reactive programming - Dirk Janssen (presentation 13th SPIN Meetup)
Reactive programming - Dirk Janssen (presentation 13th SPIN Meetup)Reactive programming - Dirk Janssen (presentation 13th SPIN Meetup)
Reactive programming - Dirk Janssen (presentation 13th SPIN Meetup)
 
Meetup hip 18 april 2017
Meetup hip 18 april 2017Meetup hip 18 april 2017
Meetup hip 18 april 2017
 
Rubix - Serverless architecture
Rubix - Serverless architectureRubix - Serverless architecture
Rubix - Serverless architecture
 
Crowd Designing Microservices Architecture
Crowd Designing Microservices ArchitectureCrowd Designing Microservices Architecture
Crowd Designing Microservices Architecture
 
Microservices - an integration perspective
Microservices - an integration perspectiveMicroservices - an integration perspective
Microservices - an integration perspective
 
RubiX ID - Big Data - Ruben Middeljans, Stephan Vos
RubiX ID - Big Data - Ruben Middeljans, Stephan VosRubiX ID - Big Data - Ruben Middeljans, Stephan Vos
RubiX ID - Big Data - Ruben Middeljans, Stephan Vos
 
RubiX ID - Continuous Integration & Continuous Delivery - Roel van den Berg, ...
RubiX ID - Continuous Integration & Continuous Delivery - Roel van den Berg, ...RubiX ID - Continuous Integration & Continuous Delivery - Roel van den Berg, ...
RubiX ID - Continuous Integration & Continuous Delivery - Roel van den Berg, ...
 
RubiX ID - SOA Governance - Wouter de Vries
RubiX ID - SOA Governance - Wouter de VriesRubiX ID - SOA Governance - Wouter de Vries
RubiX ID - SOA Governance - Wouter de Vries
 
RubiX ID - SOA Security - Ingrid Cox
RubiX ID - SOA Security - Ingrid CoxRubiX ID - SOA Security - Ingrid Cox
RubiX ID - SOA Security - Ingrid Cox
 
RubiX ID - Tibco business works™ 6 in de praktijk - Bart de Koning en Marcel ...
RubiX ID - Tibco business works™ 6 in de praktijk - Bart de Koning en Marcel ...RubiX ID - Tibco business works™ 6 in de praktijk - Bart de Koning en Marcel ...
RubiX ID - Tibco business works™ 6 in de praktijk - Bart de Koning en Marcel ...
 
RubiX ID - API management - Pim Gaemers
RubiX ID - API management - Pim GaemersRubiX ID - API management - Pim Gaemers
RubiX ID - API management - Pim Gaemers
 

Último

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
 
Leveraging AI for Mobile App Testing on Real Devices | Applitools + Kobiton
Leveraging AI for Mobile App Testing on Real Devices | Applitools + KobitonLeveraging AI for Mobile App Testing on Real Devices | Applitools + Kobiton
Leveraging AI for Mobile App Testing on Real Devices | Applitools + KobitonApplitools
 
Simplifying Microservices & Apps - The art of effortless development - Meetup...
Simplifying Microservices & Apps - The art of effortless development - Meetup...Simplifying Microservices & Apps - The art of effortless development - Meetup...
Simplifying Microservices & Apps - The art of effortless development - Meetup...Rob Geurden
 
Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...
Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...
Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...OnePlan Solutions
 
Keeping your build tool updated in a multi repository world
Keeping your build tool updated in a multi repository worldKeeping your build tool updated in a multi repository world
Keeping your build tool updated in a multi repository worldRoberto Pérez Alcolea
 
Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...
Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...
Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...OnePlan Solutions
 
The Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptx
The Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptxThe Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptx
The Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptxRTS corp
 
Zer0con 2024 final share short version.pdf
Zer0con 2024 final share short version.pdfZer0con 2024 final share short version.pdf
Zer0con 2024 final share short version.pdfmaor17
 
Effectively Troubleshoot 9 Types of OutOfMemoryError
Effectively Troubleshoot 9 Types of OutOfMemoryErrorEffectively Troubleshoot 9 Types of OutOfMemoryError
Effectively Troubleshoot 9 Types of OutOfMemoryErrorTier1 app
 
Amazon Bedrock in Action - presentation of the Bedrock's capabilities
Amazon Bedrock in Action - presentation of the Bedrock's capabilitiesAmazon Bedrock in Action - presentation of the Bedrock's capabilities
Amazon Bedrock in Action - presentation of the Bedrock's capabilitiesKrzysztofKkol1
 
GraphSummit Madrid - Product Vision and Roadmap - Luis Salvador Neo4j
GraphSummit Madrid - Product Vision and Roadmap - Luis Salvador Neo4jGraphSummit Madrid - Product Vision and Roadmap - Luis Salvador Neo4j
GraphSummit Madrid - Product Vision and Roadmap - Luis Salvador Neo4jNeo4j
 
eSoftTools IMAP Backup Software and migration tools
eSoftTools IMAP Backup Software and migration toolseSoftTools IMAP Backup Software and migration tools
eSoftTools IMAP Backup Software and migration toolsosttopstonverter
 
UI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptxUI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptxAndreas Kunz
 
Comparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdfComparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdfDrew Moseley
 
Post Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on IdentityPost Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on Identityteam-WIBU
 
Enhancing Supply Chain Visibility with Cargo Cloud Solutions.pdf
Enhancing Supply Chain Visibility with Cargo Cloud Solutions.pdfEnhancing Supply Chain Visibility with Cargo Cloud Solutions.pdf
Enhancing Supply Chain Visibility with Cargo Cloud Solutions.pdfRTS corp
 
Ronisha Informatics Private Limited Catalogue
Ronisha Informatics Private Limited CatalogueRonisha Informatics Private Limited Catalogue
Ronisha Informatics Private Limited Catalogueitservices996
 
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
 
OpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full Recording
OpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full RecordingOpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full Recording
OpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full RecordingShane Coughlan
 
2024-04-09 - From Complexity to Clarity - AWS Summit AMS.pdf
2024-04-09 - From Complexity to Clarity - AWS Summit AMS.pdf2024-04-09 - From Complexity to Clarity - AWS Summit AMS.pdf
2024-04-09 - From Complexity to Clarity - AWS Summit AMS.pdfAndrey Devyatkin
 

Último (20)

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
 
Leveraging AI for Mobile App Testing on Real Devices | Applitools + Kobiton
Leveraging AI for Mobile App Testing on Real Devices | Applitools + KobitonLeveraging AI for Mobile App Testing on Real Devices | Applitools + Kobiton
Leveraging AI for Mobile App Testing on Real Devices | Applitools + Kobiton
 
Simplifying Microservices & Apps - The art of effortless development - Meetup...
Simplifying Microservices & Apps - The art of effortless development - Meetup...Simplifying Microservices & Apps - The art of effortless development - Meetup...
Simplifying Microservices & Apps - The art of effortless development - Meetup...
 
Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...
Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...
Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...
 
Keeping your build tool updated in a multi repository world
Keeping your build tool updated in a multi repository worldKeeping your build tool updated in a multi repository world
Keeping your build tool updated in a multi repository world
 
Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...
Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...
Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...
 
The Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptx
The Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptxThe Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptx
The Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptx
 
Zer0con 2024 final share short version.pdf
Zer0con 2024 final share short version.pdfZer0con 2024 final share short version.pdf
Zer0con 2024 final share short version.pdf
 
Effectively Troubleshoot 9 Types of OutOfMemoryError
Effectively Troubleshoot 9 Types of OutOfMemoryErrorEffectively Troubleshoot 9 Types of OutOfMemoryError
Effectively Troubleshoot 9 Types of OutOfMemoryError
 
Amazon Bedrock in Action - presentation of the Bedrock's capabilities
Amazon Bedrock in Action - presentation of the Bedrock's capabilitiesAmazon Bedrock in Action - presentation of the Bedrock's capabilities
Amazon Bedrock in Action - presentation of the Bedrock's capabilities
 
GraphSummit Madrid - Product Vision and Roadmap - Luis Salvador Neo4j
GraphSummit Madrid - Product Vision and Roadmap - Luis Salvador Neo4jGraphSummit Madrid - Product Vision and Roadmap - Luis Salvador Neo4j
GraphSummit Madrid - Product Vision and Roadmap - Luis Salvador Neo4j
 
eSoftTools IMAP Backup Software and migration tools
eSoftTools IMAP Backup Software and migration toolseSoftTools IMAP Backup Software and migration tools
eSoftTools IMAP Backup Software and migration tools
 
UI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptxUI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptx
 
Comparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdfComparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdf
 
Post Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on IdentityPost Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on Identity
 
Enhancing Supply Chain Visibility with Cargo Cloud Solutions.pdf
Enhancing Supply Chain Visibility with Cargo Cloud Solutions.pdfEnhancing Supply Chain Visibility with Cargo Cloud Solutions.pdf
Enhancing Supply Chain Visibility with Cargo Cloud Solutions.pdf
 
Ronisha Informatics Private Limited Catalogue
Ronisha Informatics Private Limited CatalogueRonisha Informatics Private Limited Catalogue
Ronisha Informatics Private Limited Catalogue
 
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
 
OpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full Recording
OpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full RecordingOpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full Recording
OpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full Recording
 
2024-04-09 - From Complexity to Clarity - AWS Summit AMS.pdf
2024-04-09 - From Complexity to Clarity - AWS Summit AMS.pdf2024-04-09 - From Complexity to Clarity - AWS Summit AMS.pdf
2024-04-09 - From Complexity to Clarity - AWS Summit AMS.pdf
 

Beyond the Manifesto: Reactive Streams with Akka and Alpakka

  • 2. László van den Hoek • Will code for food since 2008 • Rubix/Lightbend partnership instigator • Currently @ KLPD 👮🏻 building a data platform
  • 5. Fast producer, slow consumer OutOfMemoryError
  • 6. Use cases for managing control flow • Upstream supply exceeds downstream capacity • …constantly, but cannot scale downstream • …occasionally; bursty source. • Messages need to be processed in-order • Partitioning and sharding may help, but maybe not enough • Efficient use of resources • Provision for what you need, not for what you (could) get • Concrete example: sensor data
  • 7. Reactive Streams • Available since 2013; latest version: 1.0.2 (19-12-2017) • “asynchronous streams of data with non-blocking back pressure” • a.k.a. async pull-push flow control • 4 interfaces, 7 methods, 43 rules for implementors: • Publisher<T> • subscribe(Subscriber<? super T> s) • Subscriber<T> • onSubscribe(Subscription s), onNext(T t), onError(Throwable t), onComplete() • Subscription • request(long n), cancel() • Processor<T,R> extends Subscriber<T>, Publisher<R> • Included in Java SE since JDK9 through JEP-266 as java.util.concurrent.Flow.* • Different implementations can be connected and converted
  • 8. request(n) request(n) onNext(t) onNext(t) Source stream (Publisher) Explicit demand model propagates backpressure Store (Subscriber) Processor Message flow
  • 9. request(1) Store (Subscriber) request(n) onNext(t) onNext(t) Source stream (Publisher) Dealing with unbackpressured upstream Processor Message flow DROPDROP
  • 10. Akka – a JVM implementation of the actor model • Actors can: • receive messages • asynchronously send messages to other actors • create and supervise child actors • change their own internal state while processing a message • When an actor encounters a problem, it will notify its parent, who can either: • Resume • Restart • Stop • Escalate
  • 11. History of the Actor model • Proposed in 1973 by Carl Hewitt • Implemented in Erlang in 1980’s – 99.9999999% (!) uptime in telco setting • Implemented in Scala in 2006 – Had problems • Akka: separate project started in 2009 – Scala and Java API’s – Replaced Scala implementation in 2012 – Java API is fully supported and up to date
  • 12. So what does an actor do? • Receive messages • Send messages to any actor address • Create and supervise child actors • Change the way it will process the next message
  • 13. Why is this a good abstraction? • Explicit about unreliability and handling it – A slow actor is a dead actor • Communicate solely by message passing – eliminates shared state bottleneck • Scale up for “free*” – Immutability means parallellizability
  • 15. Supervision (a.k.a. Let It Crash) • Resume – catch(Exception e) {}
  • 17. Supervision (a.k.a. Let It Crash) • Resume – catch(Exception e) {} • Restart – this = new Child()
  • 19. Supervision (a.k.a. Let It Crash) • Resume – catch(Exception e) {} • Restart – this = new Child() • Stop – Parent ! Terminated
  • 21. Supervision (a.k.a. Let It Crash) • Resume – catch(Exception e) {} • Restart – this = new Child() • Stop – Parent ! Terminated • Escalate – throw(e)
  • 23. Akka-specific features • On top of the actor model, Akka provides: – Ordered message arrival – Scaling out with location transparency – Tool box with high-level components • Circuit breaker
  • 24. Akka-specific features • On top of the actor model, Akka provides: – Ordered message arrival – Scaling out with location transparency – Tool box with high-level components • Circuit breaker
  • 25. Ordered message arrival • actor.send(m1) • actor.send(m2) • In receive() method of actor, you will never get m2 before m1 actoranyone m1 m2
  • 26. Doesn’t hold transitively • actor1.send(m1) • actor2.send(m2) • In receive() method of actor1: – actor2.forward(m1) actor1 anyone m1 m2 actor2 m1 No way to tell what actor2 will see
  • 27. Akka-specific features • On top of the actor model, Akka provides: – Ordered message arrival – Scaling out with location transparency – Tool box with high-level components • Circuit breaker
  • 29. Akka-specific features • On top of the actor model, Akka provides: – Ordered message arrival – Scaling out with location transparency – Tool box with high-level components • Circuit breaker
  • 31. Delegate “risky” tasks (e.g. calls over network)
  • 32. Akka Streams implements Reactive Streams Publisher Processor Subscriber Source Flow Sink implements implements implements
  • 33. Akka Streams code example: split/aggregate CompletionStage<List<Integer>> ret = Source.from(Arrays.asList("1-2-3", "2-3", "3-4")) .map(s -> Arrays.asList(s.split("-"))) //split all messages into sub-streams .splitWhen(a -> true) //now split each collection .mapConcat(f -> f) //Sub-streams logic .map(s -> Integer.valueOf(s)) //aggregate each sub-stream .reduce((a, b) -> a + b) //and merge back the result into the original stream .mergeSubstreams() .runWith(Sink.seq(), materializer); //result: List(6, 5, 7)
  • 34. Akka HTTP • Built on top of Akka Streams • HTTP requests and responses are represented with Akka Streams types: • Requests as Source<HttpRequest, ?> • Responses as Sink<HttpResponse, ?> • Message bodies as Source<ByteString, ?>
  • 35. Reactive Enterprise Integration using Akka • System integration in a nutshell: • Input • Transform • Output • Camel lets you define these separately, but no native streaming support • RxJava lets you define streams, but not in a reusable way • Akka Streams lets you define reusable, reactive components • Akka HTTP is an async HTTP client built on top of Akka Streams • Alpakka provides a set of backpressure-aware components…
  • 37. val jmsSource: Source[String, KillSwitch] = JmsConsumer.textSource( // (1) JmsConsumerSettings(connectionFactory).withBufferSize(10).withQueue("test") ) val webSocketFlow: Flow[ws.Message, ws.Message, Future[WebSocketUpgradeResponse]] = // (2) Http().webSocketClientFlow(WebSocketRequest("ws://localhost:8080/webSocket/ping")) val (runningSource, wsUpgradeResponse): (KillSwitch, Future[WebSocketUpgradeResponse]) = // stream element type jmsSource //: String .map(ws.TextMessage(_)) //: ws.TextMessage (3) .viaMat(webSocketFlow)(Keep.both) //: ws.TextMessage (4) .mapAsync(1)(wsMessageToString) //: String (5) .map("client received: " + _) //: String (6) .toMat(Sink.foreach(println))(Keep.left) // (7) .run()
  • 38. Alpakka connectors • AMQP Connector • Apache Geode connector • Apache Solr Connector • AWS DynamoDB Connector • AWS Kinesis Connector • AWS Lambda Connector • AWS S3 Connector • AWS SNS Connector • AWS SQS Connector • MongoDB Connector • MQTT Connector • OrientDB Connector • Server-sent Events (SSE) Connector • Slick (JDBC) Connector • Spring Web • Unix Domain Socket Connector • File IO • Azure Storage Queue Connector • Cassandra Connector • Elasticsearch Connector • File Connectors • FTP Connector • Google Cloud Pub/Sub • Google Firebase Cloud Messaging • HBase connector • IronMq Connector • JMS Connector • Azure • AWS Kinesis • Camel • Eventuate • FS2 • HTTP Client • MongoDB • Kafka • Pulsar • TCP
  • 41. RxJava is backwards compatible • Android does not fully support Java 8; support for java.util.function.* only since Android 7.0 • RxJava (including 2.x) targets Android 2.3+  JDK 6 • Own set of interfaces to support FP • Extra adapter classes needed for Reactive Streams
  • 42. Links • Konrad Malawski - Why Reactive? http://www.oreilly.com/programming/free/files/why-reactive.pdf

Notas del editor

  1. If the downstream does not signal demand, the upstream does not request any more items.
  2. If the downstream does not signal demand, the upstream does not request any more items.
  3. http://channel9.msdn.com/Shows/Going+Deep/Hewitt-Meijer-and-Szyperski-The-Actor-Model-everything-you-wanted-to-know-but-were-afraid-to-ask http://stackoverflow.com/questions/8426897/erlangs-99-9999999-nine-nines-reliability
  4. *: you still need to program it that way!
  5. http://doc.akka.io/docs/akka/snapshot/scala/fault-tolerance.html
  6. http://doc.akka.io/docs/akka/snapshot/scala/fault-tolerance.html
  7. http://doc.akka.io/docs/akka/snapshot/scala/fault-tolerance.html
  8. http://doc.akka.io/docs/akka/snapshot/scala/fault-tolerance.html
  9. http://www.slideshare.net/jboner/introducing-akka
  10. http://www.slideshare.net/jboner/introducing-akka
  11. http://www.slideshare.net/jboner/introducing-akka
  12. http://www.slideshare.net/jboner/introducing-akka