SlideShare une entreprise Scribd logo
1  sur  115
Télécharger pour lire hors ligne
Konrad 'ktoso' Malawski 
GeeCON 2014 @ Kraków, PL 
Akka Streams 
Konrad `@ktosopl` Malawski
hAkker @ 
Konrad `@ktosopl` Malawski
hAkker @ 
Konrad `@ktosopl` Malawski 
typesafe.com 
geecon.org 
Java.pl / KrakowScala.pl 
sckrk.com / meetup.com/Paper-Cup @ London 
GDGKrakow.pl 
meetup.com/Lambda-Lounge-Krakow
You? 
?
You? 
? 
z ?
You? 
? 
z ? 
?
You? 
? 
z ? 
? 
?
Streams
Streams
Streams 
“You cannot enter the same river twice” 
~ Heraclitus 
http://en.wikiquote.org/wiki/Heraclitus
Streams 
Real Time Stream Processing 
! 
When you attach “late” to a Publisher, 
you may miss initial elements – it’s a river of data. 
http://en.wikiquote.org/wiki/Heraclitus
Reactive Streams
Reactive Streams 
! 
! 
Stream processing
Reactive Streams 
Back-pressured 
! 
Stream processing
Reactive Streams 
Back-pressured 
Asynchronous 
Stream processing
Reactive Streams 
Back-pressured 
Asynchronous 
Stream processing 
Standardised (!)
Reactive Streams: Goals 
1. Back-pressured Asynchronous Stream processing 
! 
2. Standard implemented by many libraries
Reactive Streams - Specification & TCK 
http://reactive-streams.org
Reactive Streams - Who? 
Kaazing Corp. 
rxJava @ Netflix, 
reactor @ Pivotal (SpringSource), 
vert.x @ Red Hat, 
Twitter, 
akka-streams @ Typesafe, 
spray @ Spray.io, 
Oracle, 
java (?) – Doug Lea - SUNY Oswego 
… 
http://reactive-streams.org
Reactive Streams - Inter-op 
We want to make different implementations 
co-operate with each other. 
http://reactive-streams.org
Reactive Streams - Inter-op 
The different implementations “talk to each other” 
using the Reactive Streams protocol. 
http://reactive-streams.org
Reactive Streams - Inter-op 
The Reactive Streams SPI is NOT meant to be user-api. 
You should use one of the implementing libraries. 
http://reactive-streams.org
Back-pressure, なにですか?
Back-pressure? Example Without 
Publisher[T] Subscriber[T]
Back-pressure? Example Without 
Fast Publisher Slow Subscriber
Back-pressure? 
Push + NACK model
Back-pressure? Push + NACK model
Back-pressure? Push + NACK model 
Subscriber usually has some kind of buffer
Back-pressure? Push + NACK model
Back-pressure? Push + NACK model
Back-pressure? Push + NACK model 
What if the buffer overflows?
Back-pressure? Push + NACK model (a) 
Use bounded buffer, 
drop messages + require re-sending
Back-pressure? Push + NACK model (a) 
Use bounded buffer, 
drop messages + require re-sending Kernel does this! 
Routers do this! 
(TCP)
Back-pressure? Push + NACK model (b) 
Increase buffer size… 
Well, while you have memory available!
Back-pressure? Push + NACK model (b)
Back-pressure? 
Why NACKing is NOT enough
Back-pressure? Example NACKing 
たいへんですよ! 
Buffer overflow is imminent!
Back-pressure? Example NACKing 
Telling the Publisher to slow down / stop sending…
Back-pressure? Example NACKing 
NACK did not make it in time, 
because M was in-flight!
Back-pressure? 
speed(publisher) < speed(subscriber)
Back-pressure? Fast Subscriber, No Problem 
No problem!
Back-pressure? 
Reactive-Streams 
= 
“Dynamic Push/Pull”
Back-pressure? RS: Dynamic Push/Pull 
Just push – not safe when Slow Subscriber 
Just pull – too slow when Fast Subscriber
Back-pressure? RS: Dynamic Push/Pull 
Just push – not safe when Slow Subscriber 
Just pull – too slow when Fast Subscriber 
! 
Solution: 
Dynamic adjustment (Reactive Streams)
Back-pressure? RS: Dynamic Push/Pull 
Slow Subscriber sees it’s buffer can take 3 elements. 
Publisher will never blow up it’s buffer.
Back-pressure? RS: Dynamic Push/Pull 
Fast Publisher will send at-most 3 elements. 
This is pull-based-backpressure.
Back-pressure? RS: Dynamic Push/Pull 
Fast Subscriber can issue more Request(n), 
before more data arrives!
Back-pressure? RS: Dynamic Push/Pull 
Fast Subscriber can issue more Request(n), 
before more data arrives!
Back-pressure? RS: Accumulate demand 
Publisher accumulates total demand per subscriber.
Back-pressure? RS: Accumulate demand 
Total demand of elements is safe to publish. 
Subscriber’s buffer will not overflow.
Back-pressure? RS: Requesting “a lot” 
Fast Subscriber, can request “a lot” from Publisher. 
This is effectively “publisher push”, and is really fast. 
Buffer size is known and this is safe.
Back-pressure? RS: Dynamic Push/Pull
Back-pressure? RS: Dynamic Push/Pull 
Safe! 
Will never overflow!
わなにですか?
Akka 
Akka is a high-performance concurrency 
library for Scala and Java. 
! 
At it’s core it focuses on the Actor Model:
Akka 
Akka is a high-performance concurrency 
library for Scala and Java. 
! 
At it’s core it focuses on the Actor Model: 
An Actor can only: 
• Send / receive messages 
• Create Actors 
• Change it’s behaviour
Akka 
Akka has multiple modules: 
! 
Akka-camel: integration 
Akka-remote: remote actors 
Akka-cluster: clustering 
Akka-persistence: CQRS / Event Sourcing 
Akka-streams: stream processing 
…
Akka Streams 
0.7 early preview
Akka Streams – Linear Flow
Akka Streams – Linear Flow
Akka Streams – Linear Flow
Akka Streams – Linear Flow
Akka Streams – Linear Flow 
FlowFrom[Double].map(_.toInt). [...] 
No Source attached yet. 
“Pipe ready to work with Doubles”.
Akka Streams – Linear Flow 
implicit val sys = ActorSystem("tokyo-sys")! 
! 
It’s the world in which Actors live in. 
AkkaStreams uses Actors, so it needs ActorSystem.
Akka Streams – Linear Flow 
implicit val sys = ActorSystem("tokyo-sys")! 
implicit val mat = FlowMaterializer()! 
Contains logic on HOW to materialise the stream. 
Can be pure Actors, or (future) Apache Spark (in the future).
Akka Streams – Linear Flow 
implicit val sys = ActorSystem("tokyo-sys")! 
implicit val mat = FlowMaterializer()! 
You can configure it’s buffer sizes etc. 
(Or implement your own materialiser (“run on spark”))
Akka Streams – Linear Flow 
implicit val sys = ActorSystem("tokyo-sys")! 
implicit val mat = FlowMaterializer()! 
val foreachSink = ForeachSink[Int](println)! 
val mf = FlowFrom(1 to 3).withSink(foreachSink).run() 
Uses the implicit FlowMaterializer
Akka Streams – Linear Flow 
implicit val sys = ActorSystem("tokyo-sys")! 
implicit val mat = FlowMaterializer()! 
val foreachSink = ForeachSink[Int](println)! 
val mf = FlowFrom(1 to 3).withSink(foreachSink).run()(mat)
Akka Streams – Linear Flow 
val mf = FlowFrom[Int].! 
map(_ * 2).! 
withSink(ForeachSink(println)) // needs source,! 
// can NOT run
Akka Streams – Linear Flow 
val f = FlowFrom[Int].! 
map(_ * 2).! 
! ! ! withSink(ForeachSink(i => println(s"i = $i”))).! 
! ! // needs Source to run!
Akka Streams – Linear Flow 
val f = FlowFrom[Int].! 
map(_ * 2).! 
! ! ! withSink(ForeachSink(i => println(s"i = $i”))).! 
! ! // needs Source to run!
Akka Streams – Linear Flow 
val f = FlowFrom[Int].! 
map(_ * 2).! 
! ! ! withSink(ForeachSink(i => println(s"i = $i”))).! 
! ! // needs Source to run!
Akka Streams – Linear Flow 
val f = FlowFrom[Int].! 
map(_ * 2).! 
! ! ! withSink(ForeachSink(i => println(s"i = $i”))).! 
! ! // needs Source to run!
Akka Streams – Linear Flow 
val f = FlowFrom[Int].! 
map(_ * 2).! 
! ! ! withSink(ForeachSink(i => println(s"i = $i”))).! 
! ! // needs Source to run! 
! 
! ! ! f.withSource(IterableSource(1 to 10)).run()
Akka Streams – Linear Flow 
val f = FlowFrom[Int].! 
map(_ * 2).! 
! ! ! withSink(ForeachSink(i => println(s"i = $i”))).! 
! ! // needs Source to run! 
! 
! ! ! f.withSource(IterableSource(1 to 10)).run()
Akka Streams – Linear Flow 
val f = FlowFrom[Int].! 
map(_ * 2).! 
! ! ! withSink(ForeachSink(i => println(s"i = $i”))).! 
! ! // needs Source to run! 
! 
! ! ! f.withSource(IterableSource(1 to 10)).run()
Akka Streams – Linear Flow 
val f = FlowFrom[Int].! 
map(_ * 2).! 
! ! ! withSink(ForeachSink(i => println(s"i = $i”))).! 
! ! // needs Source to run! 
! 
! ! ! f.withSource(IterableSource(1 to 10)).run()
Akka Streams – Linear Flow 
val f = FlowFrom[Int].! 
map(_ * 2).! 
! ! ! withSink(ForeachSink(i => println(s"i = $i”))).! 
! ! // needs Source to run! 
! 
! ! ! f.withSource(IterableSource(1 to 10)).run()
Akka Streams – Flows are reusable 
! 
! ! ! f.withSource(IterableSource(1 to 10)).run()! 
! ! ! f.withSource(IterableSource(1 to 100)).run()! 
! ! ! f.withSource(IterableSource(1 to 1000)).run()
Akka Streams <-> Actors – Advanced 
val subscriber = system.actorOf(Props[SubStreamParent], ”parent")! 
! 
FlowFrom(1 to 100).! 
map(_.toString).! 
filter(_.length == 2).! 
drop(2).! 
groupBy(_.last).! 
publishTo(ActorSubscriber(subscriber))!
Akka Streams <-> Actors – Advanced 
val subscriber = system.actorOf(Props[SubStreamParent], ”parent")! 
! 
FlowFrom(1 to 100).! 
map(_.toString).! 
filter(_.length == 2).! 
drop(2).! 
groupBy(_.last).! 
publishTo(ActorSubscriber(subscriber))! 
Each “group” is a stream too! 
“Stream of Streams”.
Akka Streams <-> Actors – Advanced 
! 
groupBy(_.last). 
GroupBy groups “11” to group “1”, “12” to group “2” etc.
Akka Streams <-> Actors – Advanced 
! 
groupBy(_.last). 
It offers (groupKey, subStreamFlow) to Subscriber
Akka Streams <-> Actors – Advanced 
! 
groupBy(_.last). 
It can then start children, to handle the sub-flows!
Akka Streams <-> Actors – Advanced 
! 
groupBy(_.last). 
For example, one child for each group.
Akka Streams <-> Actors – Advanced 
val subscriber = system.actorOf(Props[SubStreamParent], ”parent")! 
! 
FlowFrom(1 to 100).! 
map(_.toString).! 
filter(_.length == 2).! 
drop(2).! 
groupBy(_.last).! 
publishTo(ActorSubscriber(subscriber))! 
普通 Akka Actor, will consume SubStream offers.
Akka Streams <-> Actors – Advanced 
class SubStreamParent extends ActorSubscriber ! 
with ImplicitFlowMaterializer ! 
with ActorLogging {! 
! 
override def requestStrategy = OneByOneRequestStrategy! 
! 
override def receive = {! 
case OnNext((groupId: String, subStream: FlowWithSource[_, _])) =>! 
! 
val subSub = context.actorOf(Props[SubStreamSubscriber], ! 
s"sub-$groupId")! 
subStream.publishTo(ActorSubscriber(subSub))! 
}! 
}!
Akka Streams <-> Actors – Advanced 
class SubStreamParent extends ActorSubscriber ! 
with ImplicitFlowMaterializer ! 
with ActorLogging {! 
! 
override def requestStrategy = OneByOneRequestStrategy! 
! 
override def receive = {! 
case OnNext((groupId: String, subStream: FlowWithSource[_, _])) =>! 
! 
val subSub = context.actorOf(Props[SubStreamSubscriber], ! 
s"sub-$groupId")! 
subStream.publishTo(ActorSubscriber(subSub))! 
}! 
}!
Akka Streams <-> Actors – Advanced 
class SubStreamParent extends ActorSubscriber ! 
with ImplicitFlowMaterializer ! 
with ActorLogging {! 
! 
override def requestStrategy = OneByOneRequestStrategy! 
! 
override def receive = {! 
case OnNext((groupId: String, subStream: FlowWithSource[_, _])) =>! 
! 
val subSub = context.actorOf(Props[SubStreamSubscriber], ! 
s"sub-$groupId")! 
subStream.publishTo(ActorSubscriber(subSub))! 
}! 
}!
Akka Streams <-> Actors – Advanced 
class SubStreamParent extends ActorSubscriber ! 
with ImplicitFlowMaterializer ! 
with ActorLogging {! 
! 
override def requestStrategy = OneByOneRequestStrategy! 
! 
override def receive = {! 
case OnNext((groupId: String, subStream: FlowWithSource[_, _])) =>! 
! 
val subSub = context.actorOf(Props[SubStreamSubscriber], ! 
s"sub-$groupId")! 
subStream.publishTo(ActorSubscriber(subSub))! 
}! 
}!
Akka Streams <-> Actors – Advanced 
class SubStreamParent extends ActorSubscriber ! 
with ImplicitFlowMaterializer ! 
with ActorLogging {! 
! 
override def requestStrategy = OneByOneRequestStrategy! 
! 
override def receive = {! 
case OnNext((groupId: String, subStream: FlowWithSource[_, _])) =>! 
! 
val subSub = context.actorOf(Props[SubStreamSubscriber], ! 
s"sub-$groupId")! 
subStream.publishTo(ActorSubscriber(subSub))! 
}! 
}!
Akka Streams <-> Actors – Advanced 
class SubStreamParent extends ActorSubscriber {! 
! 
override def requestStrategy = OneByOneRequestStrategy! 
! 
override def receive = {! 
case OnNext(n: String) => println(s”n = $n”) ! 
}! 
}!
Akka Streams – GraphFlow 
GraphFlow
Akka Streams – GraphFlow 
Linear Flows 
or 
non-akka pipelines 
Could be another RS implementation!
Akka Streams – GraphFlow 
Fan-out elements 
and 
Fan-in elements
Akka Streams – GraphFlow 
Fan-out elements 
and 
Fan-in elements 
Now you need a FlowGraph
Akka Streams – GraphFlow 
// first define some pipeline pieces! 
val f1 = FlowFrom[Input].map(_.toIntermediate)! 
val f2 = FlowFrom[Intermediate].map(_.enrich)! 
val f3 = FlowFrom[Enriched].filter(_.isImportant)! 
val f4 = FlowFrom[Intermediate].mapFuture(_.enrichAsync)! 
! 
// then add input and output placeholders! 
val in = SubscriberSource[Input]! 
val out = PublisherSink[Enriched]!
Akka Streams – GraphFlow
Akka Streams – GraphFlow 
val b3 = Broadcast[Int]("b3")! 
val b7 = Broadcast[Int]("b7")! 
val b11 = Broadcast[Int]("b11")! 
val m8 = Merge[Int]("m8")! 
val m9 = Merge[Int]("m9")! 
val m10 = Merge[Int]("m10")! 
val m11 = Merge[Int]("m11")! 
val in3 = IterableSource(List(3))! 
val in5 = IterableSource(List(5))! 
val in7 = IterableSource(List(7))!
Akka Streams – GraphFlow
Akka Streams – GraphFlow 
// First layer! 
in7 ~> b7! 
b7 ~> m11! 
b7 ~> m8! 
! 
in5 ~> m11! 
! 
in3 ~> b3! 
b3 ~> m8! 
b3 ~> m10!
Akka Streams – GraphFlow 
! 
// Second layer! 
m11 ~> b11! 
b11 ~> FlowFrom[Int].grouped(1000) ~> resultFuture2 ! 
b11 ~> m9! 
b11 ~> m10! 
! 
m8 ~> m9!
Akka Streams – GraphFlow 
! 
// Third layer! 
m9 ~> FlowFrom[Int].grouped(1000) ~> resultFuture9! 
m10 ~> FlowFrom[Int].grouped(1000) ~> resultFuture10!
Akka Streams – GraphFlow 
! 
// Third layer! 
m9 ~> FlowFrom[Int].grouped(1000) ~> resultFuture9! 
m10 ~> FlowFrom[Int].grouped(1000) ~> resultFuture10!
Akka Streams – GraphFlow 
! 
// Third layer! 
m9 ~> FlowFrom[Int].grouped(1000) ~> resultFuture9! 
m10 ~> FlowFrom[Int].grouped(1000) ~> resultFuture10!
Akka Streams – GraphFlow 
Sinks and Sources are “keys” 
which can be addressed within the graph 
val resultFuture2 = FutureSink[Seq[Int]]! 
val resultFuture9 = FutureSink[Seq[Int]]! 
val resultFuture10 = FutureSink[Seq[Int]]! 
! 
val g = FlowGraph { implicit b =>! 
// ...! 
m10 ~> FlowFrom[Int].grouped(1000) ~> resultFuture10! 
// ...! 
}.run()! 
! 
Await.result(g.getSinkFor(resultFuture2), 3.seconds).sorted! 
should be(List(5, 7))
Akka Streams – GraphFlow 
Sinks and Sources are “keys” 
which can be addressed within the graph 
val resultFuture2 = FutureSink[Seq[Int]]! 
val resultFuture9 = FutureSink[Seq[Int]]! 
val resultFuture10 = FutureSink[Seq[Int]]! 
! 
val g = FlowGraph { implicit b =>! 
// ...! 
m10 ~> FlowFrom[Int].grouped(1000) ~> resultFuture10! 
// ...! 
}.run()! 
! 
Await.result(g.getSinkFor(resultFuture2), 3.seconds).sorted! 
should be(List(5, 7))
Akka Streams – GraphFlow 
! 
val g = FlowGraph {}! 
FlowGraph is immutable and safe to share and re-use! 
Think of it as “the description” which then gets “run”.
Available Elements 
0.7 early preview
Available Sources 
• FutureSource 
• IterableSource 
• IteratorSource 
• PublisherSource 
• SubscriberSource 
• ThunkSource 
• TickSource (timer based) 
• … easy to add your own! 
0.7 early preview
Available operations 
• buffer 
• collect 
• concat 
• conflate 
• drop / dropWithin 
• take / takeWithin 
• filter 
• fold 
• foreach 
• groupBy 
• grouped 
• map 
• onComplete 
• prefixAndTail 
• broadcast 
• merge / “generalised merge” 
• zip 
• … possible to add your own! 
0.7 early preview
Available Sinks 
• BlackHoleSink 
• FoldSink 
• ForeachSink 
• FutureSink 
• OnCompleteSink 
• PublisherSink / FanoutPublisherSink 
• SubscriberSink 
• … easy to add your own! 
0.7 early preview
Links 
1. http://akka.io 
2. http://reactive-streams.org 
3. https://groups.google.com/group/akka-user
ありがとう 
ございました! 
Questions? http://akka.io 
ktoso @ typesafe.com 
twitter: ktosopl 
github: ktoso 
team blog: letitcrash.com
©Typesafe 2014 – All Rights Reserved

Contenu connexe

Tendances

End to End Akka Streams / Reactive Streams - from Business to Socket
End to End Akka Streams / Reactive Streams - from Business to SocketEnd to End Akka Streams / Reactive Streams - from Business to Socket
End to End Akka Streams / Reactive Streams - from Business to SocketKonrad Malawski
 
Akka-chan's Survival Guide for the Streaming World
Akka-chan's Survival Guide for the Streaming WorldAkka-chan's Survival Guide for the Streaming World
Akka-chan's Survival Guide for the Streaming WorldKonrad Malawski
 
How Reactive Streams & Akka Streams change the JVM Ecosystem
How Reactive Streams & Akka Streams change the JVM EcosystemHow Reactive Streams & Akka Streams change the JVM Ecosystem
How Reactive Streams & Akka Streams change the JVM EcosystemKonrad Malawski
 
Reactive Streams: Handling Data-Flow the Reactive Way
Reactive Streams: Handling Data-Flow the Reactive WayReactive Streams: Handling Data-Flow the Reactive Way
Reactive Streams: Handling Data-Flow the Reactive WayRoland Kuhn
 
[Japanese] How Reactive Streams and Akka Streams change the JVM Ecosystem @ R...
[Japanese] How Reactive Streams and Akka Streams change the JVM Ecosystem @ R...[Japanese] How Reactive Streams and Akka Streams change the JVM Ecosystem @ R...
[Japanese] How Reactive Streams and Akka Streams change the JVM Ecosystem @ R...Konrad Malawski
 
The Cloud-natives are RESTless @ JavaOne
The Cloud-natives are RESTless @ JavaOneThe Cloud-natives are RESTless @ JavaOne
The Cloud-natives are RESTless @ JavaOneKonrad Malawski
 
Streaming all the things with akka streams
Streaming all the things with akka streams   Streaming all the things with akka streams
Streaming all the things with akka streams Johan Andrén
 
HBase RowKey design for Akka Persistence
HBase RowKey design for Akka PersistenceHBase RowKey design for Akka Persistence
HBase RowKey design for Akka PersistenceKonrad Malawski
 
VJUG24 - Reactive Integrations with Akka Streams
VJUG24  - Reactive Integrations with Akka StreamsVJUG24  - Reactive Integrations with Akka Streams
VJUG24 - Reactive Integrations with Akka StreamsJohan Andrén
 
Building reactive distributed systems with Akka
Building reactive distributed systems with Akka Building reactive distributed systems with Akka
Building reactive distributed systems with Akka Johan Andrén
 
Understanding Akka Streams, Back Pressure, and Asynchronous Architectures
Understanding Akka Streams, Back Pressure, and Asynchronous ArchitecturesUnderstanding Akka Streams, Back Pressure, and Asynchronous Architectures
Understanding Akka Streams, Back Pressure, and Asynchronous ArchitecturesLightbend
 
A dive into akka streams: from the basics to a real-world scenario
A dive into akka streams: from the basics to a real-world scenarioA dive into akka streams: from the basics to a real-world scenario
A dive into akka streams: from the basics to a real-world scenarioGioia Ballin
 
Async - react, don't wait - PingConf
Async - react, don't wait - PingConfAsync - react, don't wait - PingConf
Async - react, don't wait - PingConfJohan Andrén
 
Reactive stream processing using Akka streams
Reactive stream processing using Akka streams Reactive stream processing using Akka streams
Reactive stream processing using Akka streams Johan Andrén
 
Reactor, Reactive streams and MicroServices
Reactor, Reactive streams and MicroServicesReactor, Reactive streams and MicroServices
Reactor, Reactive streams and MicroServicesStéphane Maldini
 
Akka streams - Umeå java usergroup
Akka streams - Umeå java usergroupAkka streams - Umeå java usergroup
Akka streams - Umeå java usergroupJohan Andrén
 
Akka Revealed: A JVM Architect's Journey From Resilient Actors To Scalable Cl...
Akka Revealed: A JVM Architect's Journey From Resilient Actors To Scalable Cl...Akka Revealed: A JVM Architect's Journey From Resilient Actors To Scalable Cl...
Akka Revealed: A JVM Architect's Journey From Resilient Actors To Scalable Cl...Lightbend
 
Reactive Web-Applications @ LambdaDays
Reactive Web-Applications @ LambdaDaysReactive Web-Applications @ LambdaDays
Reactive Web-Applications @ LambdaDaysManuel Bernhardt
 
System Integration with Akka and Apache Camel
System Integration with Akka and Apache CamelSystem Integration with Akka and Apache Camel
System Integration with Akka and Apache Camelkrasserm
 
Modernizing Infrastructures for Fast Data with Spark, Kafka, Cassandra, React...
Modernizing Infrastructures for Fast Data with Spark, Kafka, Cassandra, React...Modernizing Infrastructures for Fast Data with Spark, Kafka, Cassandra, React...
Modernizing Infrastructures for Fast Data with Spark, Kafka, Cassandra, React...Lightbend
 

Tendances (20)

End to End Akka Streams / Reactive Streams - from Business to Socket
End to End Akka Streams / Reactive Streams - from Business to SocketEnd to End Akka Streams / Reactive Streams - from Business to Socket
End to End Akka Streams / Reactive Streams - from Business to Socket
 
Akka-chan's Survival Guide for the Streaming World
Akka-chan's Survival Guide for the Streaming WorldAkka-chan's Survival Guide for the Streaming World
Akka-chan's Survival Guide for the Streaming World
 
How Reactive Streams & Akka Streams change the JVM Ecosystem
How Reactive Streams & Akka Streams change the JVM EcosystemHow Reactive Streams & Akka Streams change the JVM Ecosystem
How Reactive Streams & Akka Streams change the JVM Ecosystem
 
Reactive Streams: Handling Data-Flow the Reactive Way
Reactive Streams: Handling Data-Flow the Reactive WayReactive Streams: Handling Data-Flow the Reactive Way
Reactive Streams: Handling Data-Flow the Reactive Way
 
[Japanese] How Reactive Streams and Akka Streams change the JVM Ecosystem @ R...
[Japanese] How Reactive Streams and Akka Streams change the JVM Ecosystem @ R...[Japanese] How Reactive Streams and Akka Streams change the JVM Ecosystem @ R...
[Japanese] How Reactive Streams and Akka Streams change the JVM Ecosystem @ R...
 
The Cloud-natives are RESTless @ JavaOne
The Cloud-natives are RESTless @ JavaOneThe Cloud-natives are RESTless @ JavaOne
The Cloud-natives are RESTless @ JavaOne
 
Streaming all the things with akka streams
Streaming all the things with akka streams   Streaming all the things with akka streams
Streaming all the things with akka streams
 
HBase RowKey design for Akka Persistence
HBase RowKey design for Akka PersistenceHBase RowKey design for Akka Persistence
HBase RowKey design for Akka Persistence
 
VJUG24 - Reactive Integrations with Akka Streams
VJUG24  - Reactive Integrations with Akka StreamsVJUG24  - Reactive Integrations with Akka Streams
VJUG24 - Reactive Integrations with Akka Streams
 
Building reactive distributed systems with Akka
Building reactive distributed systems with Akka Building reactive distributed systems with Akka
Building reactive distributed systems with Akka
 
Understanding Akka Streams, Back Pressure, and Asynchronous Architectures
Understanding Akka Streams, Back Pressure, and Asynchronous ArchitecturesUnderstanding Akka Streams, Back Pressure, and Asynchronous Architectures
Understanding Akka Streams, Back Pressure, and Asynchronous Architectures
 
A dive into akka streams: from the basics to a real-world scenario
A dive into akka streams: from the basics to a real-world scenarioA dive into akka streams: from the basics to a real-world scenario
A dive into akka streams: from the basics to a real-world scenario
 
Async - react, don't wait - PingConf
Async - react, don't wait - PingConfAsync - react, don't wait - PingConf
Async - react, don't wait - PingConf
 
Reactive stream processing using Akka streams
Reactive stream processing using Akka streams Reactive stream processing using Akka streams
Reactive stream processing using Akka streams
 
Reactor, Reactive streams and MicroServices
Reactor, Reactive streams and MicroServicesReactor, Reactive streams and MicroServices
Reactor, Reactive streams and MicroServices
 
Akka streams - Umeå java usergroup
Akka streams - Umeå java usergroupAkka streams - Umeå java usergroup
Akka streams - Umeå java usergroup
 
Akka Revealed: A JVM Architect's Journey From Resilient Actors To Scalable Cl...
Akka Revealed: A JVM Architect's Journey From Resilient Actors To Scalable Cl...Akka Revealed: A JVM Architect's Journey From Resilient Actors To Scalable Cl...
Akka Revealed: A JVM Architect's Journey From Resilient Actors To Scalable Cl...
 
Reactive Web-Applications @ LambdaDays
Reactive Web-Applications @ LambdaDaysReactive Web-Applications @ LambdaDays
Reactive Web-Applications @ LambdaDays
 
System Integration with Akka and Apache Camel
System Integration with Akka and Apache CamelSystem Integration with Akka and Apache Camel
System Integration with Akka and Apache Camel
 
Modernizing Infrastructures for Fast Data with Spark, Kafka, Cassandra, React...
Modernizing Infrastructures for Fast Data with Spark, Kafka, Cassandra, React...Modernizing Infrastructures for Fast Data with Spark, Kafka, Cassandra, React...
Modernizing Infrastructures for Fast Data with Spark, Kafka, Cassandra, React...
 

En vedette

Android my Scala @ JFokus 2013
Android my Scala @ JFokus 2013Android my Scala @ JFokus 2013
Android my Scala @ JFokus 2013Konrad Malawski
 
100th SCKRK Meeting - best software engineering papers of 5 years of SCKRK
100th SCKRK Meeting - best software engineering papers of 5 years of SCKRK100th SCKRK Meeting - best software engineering papers of 5 years of SCKRK
100th SCKRK Meeting - best software engineering papers of 5 years of SCKRKKonrad Malawski
 
The things we don't see – stories of Software, Scala and Akka
The things we don't see – stories of Software, Scala and AkkaThe things we don't see – stories of Software, Scala and Akka
The things we don't see – stories of Software, Scala and AkkaKonrad Malawski
 
The Need for Async @ ScalaWorld
The Need for Async @ ScalaWorldThe Need for Async @ ScalaWorld
The Need for Async @ ScalaWorldKonrad Malawski
 
DDDing Tools = Akka Persistence
DDDing Tools = Akka PersistenceDDDing Tools = Akka Persistence
DDDing Tools = Akka PersistenceKonrad Malawski
 
Distributed Consensus A.K.A. "What do we eat for lunch?"
Distributed Consensus A.K.A. "What do we eat for lunch?"Distributed Consensus A.K.A. "What do we eat for lunch?"
Distributed Consensus A.K.A. "What do we eat for lunch?"Konrad Malawski
 
Reactive Stream Processing with Akka Streams
Reactive Stream Processing with Akka StreamsReactive Stream Processing with Akka Streams
Reactive Stream Processing with Akka StreamsKonrad Malawski
 
Akka persistence == event sourcing in 30 minutes
Akka persistence == event sourcing in 30 minutesAkka persistence == event sourcing in 30 minutes
Akka persistence == event sourcing in 30 minutesKonrad Malawski
 
Functor, Apply, Applicative And Monad
Functor, Apply, Applicative And MonadFunctor, Apply, Applicative And Monad
Functor, Apply, Applicative And MonadOliver Daff
 
Refactoring Design Patterns the Functional Way (in Scala)
Refactoring Design Patterns the Functional Way (in Scala)Refactoring Design Patterns the Functional Way (in Scala)
Refactoring Design Patterns the Functional Way (in Scala)Kfir Bloch
 
Krakow communities @ 2016
Krakow communities @ 2016Krakow communities @ 2016
Krakow communities @ 2016Konrad Malawski
 
Scala Implicits - Not to be feared
Scala Implicits - Not to be fearedScala Implicits - Not to be feared
Scala Implicits - Not to be fearedDerek Wyatt
 
JavaOne 2013: Java 8 - The Good Parts
JavaOne 2013: Java 8 - The Good PartsJavaOne 2013: Java 8 - The Good Parts
JavaOne 2013: Java 8 - The Good PartsKonrad Malawski
 
Open soucerers - jak zacząć swoją przygodę z open source
Open soucerers - jak zacząć swoją przygodę z open sourceOpen soucerers - jak zacząć swoją przygodę z open source
Open soucerers - jak zacząć swoją przygodę z open sourceKonrad Malawski
 
Scalding - the not-so-basics @ ScalaDays 2014
Scalding - the not-so-basics @ ScalaDays 2014Scalding - the not-so-basics @ ScalaDays 2014
Scalding - the not-so-basics @ ScalaDays 2014Konrad Malawski
 
Need for Async: Hot pursuit for scalable applications
Need for Async: Hot pursuit for scalable applicationsNeed for Async: Hot pursuit for scalable applications
Need for Async: Hot pursuit for scalable applicationsKonrad Malawski
 
Ebay legacy-code-retreat
Ebay legacy-code-retreatEbay legacy-code-retreat
Ebay legacy-code-retreatKonrad Malawski
 

En vedette (17)

Android my Scala @ JFokus 2013
Android my Scala @ JFokus 2013Android my Scala @ JFokus 2013
Android my Scala @ JFokus 2013
 
100th SCKRK Meeting - best software engineering papers of 5 years of SCKRK
100th SCKRK Meeting - best software engineering papers of 5 years of SCKRK100th SCKRK Meeting - best software engineering papers of 5 years of SCKRK
100th SCKRK Meeting - best software engineering papers of 5 years of SCKRK
 
The things we don't see – stories of Software, Scala and Akka
The things we don't see – stories of Software, Scala and AkkaThe things we don't see – stories of Software, Scala and Akka
The things we don't see – stories of Software, Scala and Akka
 
The Need for Async @ ScalaWorld
The Need for Async @ ScalaWorldThe Need for Async @ ScalaWorld
The Need for Async @ ScalaWorld
 
DDDing Tools = Akka Persistence
DDDing Tools = Akka PersistenceDDDing Tools = Akka Persistence
DDDing Tools = Akka Persistence
 
Distributed Consensus A.K.A. "What do we eat for lunch?"
Distributed Consensus A.K.A. "What do we eat for lunch?"Distributed Consensus A.K.A. "What do we eat for lunch?"
Distributed Consensus A.K.A. "What do we eat for lunch?"
 
Reactive Stream Processing with Akka Streams
Reactive Stream Processing with Akka StreamsReactive Stream Processing with Akka Streams
Reactive Stream Processing with Akka Streams
 
Akka persistence == event sourcing in 30 minutes
Akka persistence == event sourcing in 30 minutesAkka persistence == event sourcing in 30 minutes
Akka persistence == event sourcing in 30 minutes
 
Functor, Apply, Applicative And Monad
Functor, Apply, Applicative And MonadFunctor, Apply, Applicative And Monad
Functor, Apply, Applicative And Monad
 
Refactoring Design Patterns the Functional Way (in Scala)
Refactoring Design Patterns the Functional Way (in Scala)Refactoring Design Patterns the Functional Way (in Scala)
Refactoring Design Patterns the Functional Way (in Scala)
 
Krakow communities @ 2016
Krakow communities @ 2016Krakow communities @ 2016
Krakow communities @ 2016
 
Scala Implicits - Not to be feared
Scala Implicits - Not to be fearedScala Implicits - Not to be feared
Scala Implicits - Not to be feared
 
JavaOne 2013: Java 8 - The Good Parts
JavaOne 2013: Java 8 - The Good PartsJavaOne 2013: Java 8 - The Good Parts
JavaOne 2013: Java 8 - The Good Parts
 
Open soucerers - jak zacząć swoją przygodę z open source
Open soucerers - jak zacząć swoją przygodę z open sourceOpen soucerers - jak zacząć swoją przygodę z open source
Open soucerers - jak zacząć swoją przygodę z open source
 
Scalding - the not-so-basics @ ScalaDays 2014
Scalding - the not-so-basics @ ScalaDays 2014Scalding - the not-so-basics @ ScalaDays 2014
Scalding - the not-so-basics @ ScalaDays 2014
 
Need for Async: Hot pursuit for scalable applications
Need for Async: Hot pursuit for scalable applicationsNeed for Async: Hot pursuit for scalable applications
Need for Async: Hot pursuit for scalable applications
 
Ebay legacy-code-retreat
Ebay legacy-code-retreatEbay legacy-code-retreat
Ebay legacy-code-retreat
 

Similaire à Akka Streams Presentation Provides Overview of Reactive Programming Concepts

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
 
Exploring Reactive Integrations With Akka Streams, Alpakka And Apache Kafka
Exploring Reactive Integrations With Akka Streams, Alpakka And Apache KafkaExploring Reactive Integrations With Akka Streams, Alpakka And Apache Kafka
Exploring Reactive Integrations With Akka Streams, Alpakka And Apache KafkaLightbend
 
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
 
Paris jug ksql - 2018-06-28
Paris jug ksql - 2018-06-28Paris jug ksql - 2018-06-28
Paris jug ksql - 2018-06-28Florent Ramiere
 
Introduction to Apache Beam & No Shard Left Behind: APIs for Massive Parallel...
Introduction to Apache Beam & No Shard Left Behind: APIs for Massive Parallel...Introduction to Apache Beam & No Shard Left Behind: APIs for Massive Parallel...
Introduction to Apache Beam & No Shard Left Behind: APIs for Massive Parallel...Dan Halperin
 
Scala usergroup stockholm - reactive integrations with akka streams
Scala usergroup stockholm - reactive integrations with akka streamsScala usergroup stockholm - reactive integrations with akka streams
Scala usergroup stockholm - reactive integrations with akka streamsJohan Andrén
 
Introduction to Akka Streams [Part-I]
Introduction to Akka Streams [Part-I]Introduction to Akka Streams [Part-I]
Introduction to Akka Streams [Part-I]Knoldus Inc.
 
Networks and Types - the Future of Akka @ ScalaDays NYC 2018
Networks and Types - the Future of Akka @ ScalaDays NYC 2018Networks and Types - the Future of Akka @ ScalaDays NYC 2018
Networks and Types - the Future of Akka @ ScalaDays NYC 2018Konrad Malawski
 
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
 
Ruslan.shevchenko: most functional-day-kiev 2014
Ruslan.shevchenko: most functional-day-kiev 2014Ruslan.shevchenko: most functional-day-kiev 2014
Ruslan.shevchenko: most functional-day-kiev 2014Ruslan Shevchenko
 
Apache Kafka and KSQL in Action: Let's Build a Streaming Data Pipeline!
Apache Kafka and KSQL in Action: Let's Build a Streaming Data Pipeline!Apache Kafka and KSQL in Action: Let's Build a Streaming Data Pipeline!
Apache Kafka and KSQL in Action: Let's Build a Streaming Data Pipeline!confluent
 
Four Things to Know About Reliable Spark Streaming with Typesafe and Databricks
Four Things to Know About Reliable Spark Streaming with Typesafe and DatabricksFour Things to Know About Reliable Spark Streaming with Typesafe and Databricks
Four Things to Know About Reliable Spark Streaming with Typesafe and DatabricksLegacy Typesafe (now Lightbend)
 
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
 
Back-Pressure in Action: Handling High-Burst Workloads with Akka Streams & Ka...
Back-Pressure in Action: Handling High-Burst Workloads with Akka Streams & Ka...Back-Pressure in Action: Handling High-Burst Workloads with Akka Streams & Ka...
Back-Pressure in Action: Handling High-Burst Workloads with Akka Streams & Ka...Reactivesummit
 
Back-Pressure in Action: Handling High-Burst Workloads with Akka Streams & Kafka
Back-Pressure in Action: Handling High-Burst Workloads with Akka Streams & KafkaBack-Pressure in Action: Handling High-Burst Workloads with Akka Streams & Kafka
Back-Pressure in Action: Handling High-Burst Workloads with Akka Streams & KafkaAkara Sucharitakul
 
Reactive Summit 2017 Highlights!
Reactive Summit 2017 Highlights!Reactive Summit 2017 Highlights!
Reactive Summit 2017 Highlights!Fabio Tiriticco
 

Similaire à Akka Streams Presentation Provides Overview of Reactive Programming Concepts (20)

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
 
Exploring Reactive Integrations With Akka Streams, Alpakka And Apache Kafka
Exploring Reactive Integrations With Akka Streams, Alpakka And Apache KafkaExploring Reactive Integrations With Akka Streams, Alpakka And Apache Kafka
Exploring Reactive Integrations With Akka Streams, Alpakka And Apache Kafka
 
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...
 
Paris jug ksql - 2018-06-28
Paris jug ksql - 2018-06-28Paris jug ksql - 2018-06-28
Paris jug ksql - 2018-06-28
 
Akka streams
Akka streamsAkka streams
Akka streams
 
Introduction to Apache Beam & No Shard Left Behind: APIs for Massive Parallel...
Introduction to Apache Beam & No Shard Left Behind: APIs for Massive Parallel...Introduction to Apache Beam & No Shard Left Behind: APIs for Massive Parallel...
Introduction to Apache Beam & No Shard Left Behind: APIs for Massive Parallel...
 
Scala usergroup stockholm - reactive integrations with akka streams
Scala usergroup stockholm - reactive integrations with akka streamsScala usergroup stockholm - reactive integrations with akka streams
Scala usergroup stockholm - reactive integrations with akka streams
 
Introduction to Akka Streams [Part-I]
Introduction to Akka Streams [Part-I]Introduction to Akka Streams [Part-I]
Introduction to Akka Streams [Part-I]
 
Intro to Akka Streams
Intro to Akka StreamsIntro to Akka Streams
Intro to Akka Streams
 
Networks and Types - the Future of Akka @ ScalaDays NYC 2018
Networks and Types - the Future of Akka @ ScalaDays NYC 2018Networks and Types - the Future of Akka @ ScalaDays NYC 2018
Networks and Types - the Future of Akka @ ScalaDays NYC 2018
 
Akka Streams
Akka StreamsAkka Streams
Akka Streams
 
Spark streaming + kafka 0.10
Spark streaming + kafka 0.10Spark streaming + kafka 0.10
Spark streaming + kafka 0.10
 
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
 
Ruslan.shevchenko: most functional-day-kiev 2014
Ruslan.shevchenko: most functional-day-kiev 2014Ruslan.shevchenko: most functional-day-kiev 2014
Ruslan.shevchenko: most functional-day-kiev 2014
 
Apache Kafka and KSQL in Action: Let's Build a Streaming Data Pipeline!
Apache Kafka and KSQL in Action: Let's Build a Streaming Data Pipeline!Apache Kafka and KSQL in Action: Let's Build a Streaming Data Pipeline!
Apache Kafka and KSQL in Action: Let's Build a Streaming Data Pipeline!
 
Four Things to Know About Reliable Spark Streaming with Typesafe and Databricks
Four Things to Know About Reliable Spark Streaming with Typesafe and DatabricksFour Things to Know About Reliable Spark Streaming with Typesafe and Databricks
Four Things to Know About Reliable Spark Streaming with Typesafe and Databricks
 
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...
 
Back-Pressure in Action: Handling High-Burst Workloads with Akka Streams & Ka...
Back-Pressure in Action: Handling High-Burst Workloads with Akka Streams & Ka...Back-Pressure in Action: Handling High-Burst Workloads with Akka Streams & Ka...
Back-Pressure in Action: Handling High-Burst Workloads with Akka Streams & Ka...
 
Back-Pressure in Action: Handling High-Burst Workloads with Akka Streams & Kafka
Back-Pressure in Action: Handling High-Burst Workloads with Akka Streams & KafkaBack-Pressure in Action: Handling High-Burst Workloads with Akka Streams & Kafka
Back-Pressure in Action: Handling High-Burst Workloads with Akka Streams & Kafka
 
Reactive Summit 2017 Highlights!
Reactive Summit 2017 Highlights!Reactive Summit 2017 Highlights!
Reactive Summit 2017 Highlights!
 

Dernier

Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 

Dernier (20)

Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 

Akka Streams Presentation Provides Overview of Reactive Programming Concepts

  • 1. Konrad 'ktoso' Malawski GeeCON 2014 @ Kraków, PL Akka Streams Konrad `@ktosopl` Malawski
  • 2. hAkker @ Konrad `@ktosopl` Malawski
  • 3. hAkker @ Konrad `@ktosopl` Malawski typesafe.com geecon.org Java.pl / KrakowScala.pl sckrk.com / meetup.com/Paper-Cup @ London GDGKrakow.pl meetup.com/Lambda-Lounge-Krakow
  • 6. You? ? z ? ?
  • 7. You? ? z ? ? ?
  • 10. Streams “You cannot enter the same river twice” ~ Heraclitus http://en.wikiquote.org/wiki/Heraclitus
  • 11. Streams Real Time Stream Processing ! When you attach “late” to a Publisher, you may miss initial elements – it’s a river of data. http://en.wikiquote.org/wiki/Heraclitus
  • 13. Reactive Streams ! ! Stream processing
  • 14. Reactive Streams Back-pressured ! Stream processing
  • 15. Reactive Streams Back-pressured Asynchronous Stream processing
  • 16. Reactive Streams Back-pressured Asynchronous Stream processing Standardised (!)
  • 17. Reactive Streams: Goals 1. Back-pressured Asynchronous Stream processing ! 2. Standard implemented by many libraries
  • 18. Reactive Streams - Specification & TCK http://reactive-streams.org
  • 19. Reactive Streams - Who? Kaazing Corp. rxJava @ Netflix, reactor @ Pivotal (SpringSource), vert.x @ Red Hat, Twitter, akka-streams @ Typesafe, spray @ Spray.io, Oracle, java (?) – Doug Lea - SUNY Oswego … http://reactive-streams.org
  • 20. Reactive Streams - Inter-op We want to make different implementations co-operate with each other. http://reactive-streams.org
  • 21. Reactive Streams - Inter-op The different implementations “talk to each other” using the Reactive Streams protocol. http://reactive-streams.org
  • 22. Reactive Streams - Inter-op The Reactive Streams SPI is NOT meant to be user-api. You should use one of the implementing libraries. http://reactive-streams.org
  • 24. Back-pressure? Example Without Publisher[T] Subscriber[T]
  • 25. Back-pressure? Example Without Fast Publisher Slow Subscriber
  • 26. Back-pressure? Push + NACK model
  • 27. Back-pressure? Push + NACK model
  • 28. Back-pressure? Push + NACK model Subscriber usually has some kind of buffer
  • 29. Back-pressure? Push + NACK model
  • 30. Back-pressure? Push + NACK model
  • 31. Back-pressure? Push + NACK model What if the buffer overflows?
  • 32. Back-pressure? Push + NACK model (a) Use bounded buffer, drop messages + require re-sending
  • 33. Back-pressure? Push + NACK model (a) Use bounded buffer, drop messages + require re-sending Kernel does this! Routers do this! (TCP)
  • 34. Back-pressure? Push + NACK model (b) Increase buffer size… Well, while you have memory available!
  • 35. Back-pressure? Push + NACK model (b)
  • 36. Back-pressure? Why NACKing is NOT enough
  • 37. Back-pressure? Example NACKing たいへんですよ! Buffer overflow is imminent!
  • 38. Back-pressure? Example NACKing Telling the Publisher to slow down / stop sending…
  • 39. Back-pressure? Example NACKing NACK did not make it in time, because M was in-flight!
  • 41. Back-pressure? Fast Subscriber, No Problem No problem!
  • 42. Back-pressure? Reactive-Streams = “Dynamic Push/Pull”
  • 43. Back-pressure? RS: Dynamic Push/Pull Just push – not safe when Slow Subscriber Just pull – too slow when Fast Subscriber
  • 44. Back-pressure? RS: Dynamic Push/Pull Just push – not safe when Slow Subscriber Just pull – too slow when Fast Subscriber ! Solution: Dynamic adjustment (Reactive Streams)
  • 45. Back-pressure? RS: Dynamic Push/Pull Slow Subscriber sees it’s buffer can take 3 elements. Publisher will never blow up it’s buffer.
  • 46. Back-pressure? RS: Dynamic Push/Pull Fast Publisher will send at-most 3 elements. This is pull-based-backpressure.
  • 47. Back-pressure? RS: Dynamic Push/Pull Fast Subscriber can issue more Request(n), before more data arrives!
  • 48. Back-pressure? RS: Dynamic Push/Pull Fast Subscriber can issue more Request(n), before more data arrives!
  • 49. Back-pressure? RS: Accumulate demand Publisher accumulates total demand per subscriber.
  • 50. Back-pressure? RS: Accumulate demand Total demand of elements is safe to publish. Subscriber’s buffer will not overflow.
  • 51. Back-pressure? RS: Requesting “a lot” Fast Subscriber, can request “a lot” from Publisher. This is effectively “publisher push”, and is really fast. Buffer size is known and this is safe.
  • 53. Back-pressure? RS: Dynamic Push/Pull Safe! Will never overflow!
  • 55. Akka Akka is a high-performance concurrency library for Scala and Java. ! At it’s core it focuses on the Actor Model:
  • 56. Akka Akka is a high-performance concurrency library for Scala and Java. ! At it’s core it focuses on the Actor Model: An Actor can only: • Send / receive messages • Create Actors • Change it’s behaviour
  • 57. Akka Akka has multiple modules: ! Akka-camel: integration Akka-remote: remote actors Akka-cluster: clustering Akka-persistence: CQRS / Event Sourcing Akka-streams: stream processing …
  • 58. Akka Streams 0.7 early preview
  • 59. Akka Streams – Linear Flow
  • 60. Akka Streams – Linear Flow
  • 61. Akka Streams – Linear Flow
  • 62. Akka Streams – Linear Flow
  • 63. Akka Streams – Linear Flow FlowFrom[Double].map(_.toInt). [...] No Source attached yet. “Pipe ready to work with Doubles”.
  • 64. Akka Streams – Linear Flow implicit val sys = ActorSystem("tokyo-sys")! ! It’s the world in which Actors live in. AkkaStreams uses Actors, so it needs ActorSystem.
  • 65. Akka Streams – Linear Flow implicit val sys = ActorSystem("tokyo-sys")! implicit val mat = FlowMaterializer()! Contains logic on HOW to materialise the stream. Can be pure Actors, or (future) Apache Spark (in the future).
  • 66. Akka Streams – Linear Flow implicit val sys = ActorSystem("tokyo-sys")! implicit val mat = FlowMaterializer()! You can configure it’s buffer sizes etc. (Or implement your own materialiser (“run on spark”))
  • 67. Akka Streams – Linear Flow implicit val sys = ActorSystem("tokyo-sys")! implicit val mat = FlowMaterializer()! val foreachSink = ForeachSink[Int](println)! val mf = FlowFrom(1 to 3).withSink(foreachSink).run() Uses the implicit FlowMaterializer
  • 68. Akka Streams – Linear Flow implicit val sys = ActorSystem("tokyo-sys")! implicit val mat = FlowMaterializer()! val foreachSink = ForeachSink[Int](println)! val mf = FlowFrom(1 to 3).withSink(foreachSink).run()(mat)
  • 69. Akka Streams – Linear Flow val mf = FlowFrom[Int].! map(_ * 2).! withSink(ForeachSink(println)) // needs source,! // can NOT run
  • 70. Akka Streams – Linear Flow val f = FlowFrom[Int].! map(_ * 2).! ! ! ! withSink(ForeachSink(i => println(s"i = $i”))).! ! ! // needs Source to run!
  • 71. Akka Streams – Linear Flow val f = FlowFrom[Int].! map(_ * 2).! ! ! ! withSink(ForeachSink(i => println(s"i = $i”))).! ! ! // needs Source to run!
  • 72. Akka Streams – Linear Flow val f = FlowFrom[Int].! map(_ * 2).! ! ! ! withSink(ForeachSink(i => println(s"i = $i”))).! ! ! // needs Source to run!
  • 73. Akka Streams – Linear Flow val f = FlowFrom[Int].! map(_ * 2).! ! ! ! withSink(ForeachSink(i => println(s"i = $i”))).! ! ! // needs Source to run!
  • 74. Akka Streams – Linear Flow val f = FlowFrom[Int].! map(_ * 2).! ! ! ! withSink(ForeachSink(i => println(s"i = $i”))).! ! ! // needs Source to run! ! ! ! ! f.withSource(IterableSource(1 to 10)).run()
  • 75. Akka Streams – Linear Flow val f = FlowFrom[Int].! map(_ * 2).! ! ! ! withSink(ForeachSink(i => println(s"i = $i”))).! ! ! // needs Source to run! ! ! ! ! f.withSource(IterableSource(1 to 10)).run()
  • 76. Akka Streams – Linear Flow val f = FlowFrom[Int].! map(_ * 2).! ! ! ! withSink(ForeachSink(i => println(s"i = $i”))).! ! ! // needs Source to run! ! ! ! ! f.withSource(IterableSource(1 to 10)).run()
  • 77. Akka Streams – Linear Flow val f = FlowFrom[Int].! map(_ * 2).! ! ! ! withSink(ForeachSink(i => println(s"i = $i”))).! ! ! // needs Source to run! ! ! ! ! f.withSource(IterableSource(1 to 10)).run()
  • 78. Akka Streams – Linear Flow val f = FlowFrom[Int].! map(_ * 2).! ! ! ! withSink(ForeachSink(i => println(s"i = $i”))).! ! ! // needs Source to run! ! ! ! ! f.withSource(IterableSource(1 to 10)).run()
  • 79. Akka Streams – Flows are reusable ! ! ! ! f.withSource(IterableSource(1 to 10)).run()! ! ! ! f.withSource(IterableSource(1 to 100)).run()! ! ! ! f.withSource(IterableSource(1 to 1000)).run()
  • 80. Akka Streams <-> Actors – Advanced val subscriber = system.actorOf(Props[SubStreamParent], ”parent")! ! FlowFrom(1 to 100).! map(_.toString).! filter(_.length == 2).! drop(2).! groupBy(_.last).! publishTo(ActorSubscriber(subscriber))!
  • 81. Akka Streams <-> Actors – Advanced val subscriber = system.actorOf(Props[SubStreamParent], ”parent")! ! FlowFrom(1 to 100).! map(_.toString).! filter(_.length == 2).! drop(2).! groupBy(_.last).! publishTo(ActorSubscriber(subscriber))! Each “group” is a stream too! “Stream of Streams”.
  • 82. Akka Streams <-> Actors – Advanced ! groupBy(_.last). GroupBy groups “11” to group “1”, “12” to group “2” etc.
  • 83. Akka Streams <-> Actors – Advanced ! groupBy(_.last). It offers (groupKey, subStreamFlow) to Subscriber
  • 84. Akka Streams <-> Actors – Advanced ! groupBy(_.last). It can then start children, to handle the sub-flows!
  • 85. Akka Streams <-> Actors – Advanced ! groupBy(_.last). For example, one child for each group.
  • 86. Akka Streams <-> Actors – Advanced val subscriber = system.actorOf(Props[SubStreamParent], ”parent")! ! FlowFrom(1 to 100).! map(_.toString).! filter(_.length == 2).! drop(2).! groupBy(_.last).! publishTo(ActorSubscriber(subscriber))! 普通 Akka Actor, will consume SubStream offers.
  • 87. Akka Streams <-> Actors – Advanced class SubStreamParent extends ActorSubscriber ! with ImplicitFlowMaterializer ! with ActorLogging {! ! override def requestStrategy = OneByOneRequestStrategy! ! override def receive = {! case OnNext((groupId: String, subStream: FlowWithSource[_, _])) =>! ! val subSub = context.actorOf(Props[SubStreamSubscriber], ! s"sub-$groupId")! subStream.publishTo(ActorSubscriber(subSub))! }! }!
  • 88. Akka Streams <-> Actors – Advanced class SubStreamParent extends ActorSubscriber ! with ImplicitFlowMaterializer ! with ActorLogging {! ! override def requestStrategy = OneByOneRequestStrategy! ! override def receive = {! case OnNext((groupId: String, subStream: FlowWithSource[_, _])) =>! ! val subSub = context.actorOf(Props[SubStreamSubscriber], ! s"sub-$groupId")! subStream.publishTo(ActorSubscriber(subSub))! }! }!
  • 89. Akka Streams <-> Actors – Advanced class SubStreamParent extends ActorSubscriber ! with ImplicitFlowMaterializer ! with ActorLogging {! ! override def requestStrategy = OneByOneRequestStrategy! ! override def receive = {! case OnNext((groupId: String, subStream: FlowWithSource[_, _])) =>! ! val subSub = context.actorOf(Props[SubStreamSubscriber], ! s"sub-$groupId")! subStream.publishTo(ActorSubscriber(subSub))! }! }!
  • 90. Akka Streams <-> Actors – Advanced class SubStreamParent extends ActorSubscriber ! with ImplicitFlowMaterializer ! with ActorLogging {! ! override def requestStrategy = OneByOneRequestStrategy! ! override def receive = {! case OnNext((groupId: String, subStream: FlowWithSource[_, _])) =>! ! val subSub = context.actorOf(Props[SubStreamSubscriber], ! s"sub-$groupId")! subStream.publishTo(ActorSubscriber(subSub))! }! }!
  • 91. Akka Streams <-> Actors – Advanced class SubStreamParent extends ActorSubscriber ! with ImplicitFlowMaterializer ! with ActorLogging {! ! override def requestStrategy = OneByOneRequestStrategy! ! override def receive = {! case OnNext((groupId: String, subStream: FlowWithSource[_, _])) =>! ! val subSub = context.actorOf(Props[SubStreamSubscriber], ! s"sub-$groupId")! subStream.publishTo(ActorSubscriber(subSub))! }! }!
  • 92. Akka Streams <-> Actors – Advanced class SubStreamParent extends ActorSubscriber {! ! override def requestStrategy = OneByOneRequestStrategy! ! override def receive = {! case OnNext(n: String) => println(s”n = $n”) ! }! }!
  • 93. Akka Streams – GraphFlow GraphFlow
  • 94. Akka Streams – GraphFlow Linear Flows or non-akka pipelines Could be another RS implementation!
  • 95. Akka Streams – GraphFlow Fan-out elements and Fan-in elements
  • 96. Akka Streams – GraphFlow Fan-out elements and Fan-in elements Now you need a FlowGraph
  • 97. Akka Streams – GraphFlow // first define some pipeline pieces! val f1 = FlowFrom[Input].map(_.toIntermediate)! val f2 = FlowFrom[Intermediate].map(_.enrich)! val f3 = FlowFrom[Enriched].filter(_.isImportant)! val f4 = FlowFrom[Intermediate].mapFuture(_.enrichAsync)! ! // then add input and output placeholders! val in = SubscriberSource[Input]! val out = PublisherSink[Enriched]!
  • 98. Akka Streams – GraphFlow
  • 99. Akka Streams – GraphFlow val b3 = Broadcast[Int]("b3")! val b7 = Broadcast[Int]("b7")! val b11 = Broadcast[Int]("b11")! val m8 = Merge[Int]("m8")! val m9 = Merge[Int]("m9")! val m10 = Merge[Int]("m10")! val m11 = Merge[Int]("m11")! val in3 = IterableSource(List(3))! val in5 = IterableSource(List(5))! val in7 = IterableSource(List(7))!
  • 100. Akka Streams – GraphFlow
  • 101. Akka Streams – GraphFlow // First layer! in7 ~> b7! b7 ~> m11! b7 ~> m8! ! in5 ~> m11! ! in3 ~> b3! b3 ~> m8! b3 ~> m10!
  • 102. Akka Streams – GraphFlow ! // Second layer! m11 ~> b11! b11 ~> FlowFrom[Int].grouped(1000) ~> resultFuture2 ! b11 ~> m9! b11 ~> m10! ! m8 ~> m9!
  • 103. Akka Streams – GraphFlow ! // Third layer! m9 ~> FlowFrom[Int].grouped(1000) ~> resultFuture9! m10 ~> FlowFrom[Int].grouped(1000) ~> resultFuture10!
  • 104. Akka Streams – GraphFlow ! // Third layer! m9 ~> FlowFrom[Int].grouped(1000) ~> resultFuture9! m10 ~> FlowFrom[Int].grouped(1000) ~> resultFuture10!
  • 105. Akka Streams – GraphFlow ! // Third layer! m9 ~> FlowFrom[Int].grouped(1000) ~> resultFuture9! m10 ~> FlowFrom[Int].grouped(1000) ~> resultFuture10!
  • 106. Akka Streams – GraphFlow Sinks and Sources are “keys” which can be addressed within the graph val resultFuture2 = FutureSink[Seq[Int]]! val resultFuture9 = FutureSink[Seq[Int]]! val resultFuture10 = FutureSink[Seq[Int]]! ! val g = FlowGraph { implicit b =>! // ...! m10 ~> FlowFrom[Int].grouped(1000) ~> resultFuture10! // ...! }.run()! ! Await.result(g.getSinkFor(resultFuture2), 3.seconds).sorted! should be(List(5, 7))
  • 107. Akka Streams – GraphFlow Sinks and Sources are “keys” which can be addressed within the graph val resultFuture2 = FutureSink[Seq[Int]]! val resultFuture9 = FutureSink[Seq[Int]]! val resultFuture10 = FutureSink[Seq[Int]]! ! val g = FlowGraph { implicit b =>! // ...! m10 ~> FlowFrom[Int].grouped(1000) ~> resultFuture10! // ...! }.run()! ! Await.result(g.getSinkFor(resultFuture2), 3.seconds).sorted! should be(List(5, 7))
  • 108. Akka Streams – GraphFlow ! val g = FlowGraph {}! FlowGraph is immutable and safe to share and re-use! Think of it as “the description” which then gets “run”.
  • 109. Available Elements 0.7 early preview
  • 110. Available Sources • FutureSource • IterableSource • IteratorSource • PublisherSource • SubscriberSource • ThunkSource • TickSource (timer based) • … easy to add your own! 0.7 early preview
  • 111. Available operations • buffer • collect • concat • conflate • drop / dropWithin • take / takeWithin • filter • fold • foreach • groupBy • grouped • map • onComplete • prefixAndTail • broadcast • merge / “generalised merge” • zip • … possible to add your own! 0.7 early preview
  • 112. Available Sinks • BlackHoleSink • FoldSink • ForeachSink • FutureSink • OnCompleteSink • PublisherSink / FanoutPublisherSink • SubscriberSink • … easy to add your own! 0.7 early preview
  • 113. Links 1. http://akka.io 2. http://reactive-streams.org 3. https://groups.google.com/group/akka-user
  • 114. ありがとう ございました! Questions? http://akka.io ktoso @ typesafe.com twitter: ktosopl github: ktoso team blog: letitcrash.com
  • 115. ©Typesafe 2014 – All Rights Reserved