SlideShare a Scribd company logo
1 of 124
Download to read offline
Konrad 'ktoso' Malawski 
GeeCON 2014 @ Kraków, PL 
Akka Streams 
Konrad `@ktosopl` Malawski 
OST: Tomas Dvorak ./‘ ./‘
hAkker @ 
Konrad `@ktosopl` Malawski 
Akka Team, 
Reactive Streams TCK
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? 
?
Czech User Group? 
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
What is back-pressure?
Back-pressure? Example Without 
Publisher[T] Subscriber[T]
Back-pressure? Example Without 
Fast Publisher Slow Subscriber
Back-pressure? 
“Why would I need that!?”
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? 
NACKing is NOT enough.
Negative ACKnowledgement
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
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. 
Publisher can accumulate demand.
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 issue arbitrary large requests, 
including “gimme all you got” (Long.MaxValue)
Back-pressure? RS: Dynamic Push/Pull 
MAX 
speed
Back-pressure? RS: Dynamic Push/Pull 
Easy 
MAX 
speed
How does fit all this?
Akka 
Akka has multiple modules: 
akka-actor: actors (concurrency abstraction) 
akka-camel: integration 
akka-remote: remote actors 
akka-cluster: clustering 
akka-persistence: CQRS / Event Sourcing 
akka-streams: stream processing 
…
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 and receive messages 
• Create Actors 
• Change it’s behaviour
Akka 
class Player extends Actor { 
def receive = { 
case NextTurn => sender() ! decideOnMove() 
} 
def decideOnMove(): Move = ??? 
}
Akka 
Akka has multiple modules: 
akka-actor: actors (concurrency abstraction) 
akka-camel: integration 
akka-remote: remote actors 
akka-cluster: clustering 
akka-persistence: CQRS / Event Sourcing 
akka-streams: stream processing 
…
Akka Streams 
0.9 early preview
Akka Streams – Linear Flow
Akka Streams – Linear Flow
Akka Streams – Linear Flow
Akka Streams – Linear Flow
Akka Streams – Linear Flow 
Flow[Double].map(_.toInt). [...] 
No Source attached yet. 
“Pipe ready to work with Doubles”.
Akka Streams – Linear Flow 
implicit val sys = ActorSystem("tokyo-sys") 
An ActorSystem is 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.
Akka Streams – Linear Flow 
implicit val sys = ActorSystem("tokyo-sys") 
implicit val mat = FlowMaterializer() 
A materialiser chooses HOW to materialise a Stream. 
The Flow’s AST is fully “lifted”. 
The Materialiser can choose to materialise the Flow in any way it sees fit. 
Our implementation uses Actors. 
But you could easily plug in an SparkMaterializer!
Akka Streams – Linear Flow 
implicit val sys = ActorSystem("tokyo-sys") 
implicit val mat = FlowMaterializer() 
You can configure it’s buffer sizes etc.
Akka Streams – Linear Flow 
implicit val sys = ActorSystem("tokyo-sys") 
implicit val mat = FlowMaterializer() 
val foreachSink = Sink.foreach[Int](println) 
val mf = Source(1 to 3).runWith(foreachSink)
Akka Streams – Linear Flow 
implicit val sys = ActorSystem("tokyo-sys") 
implicit val mat = FlowMaterializer() 
val foreachSink = Sink.foreach[Int](println) 
val mf = FlowFrom(1 to 3).runWith(foreachSink)(mat) 
Uses the implicit FlowMaterializer
Akka Streams – Linear Flow 
implicit val sys = ActorSystem("tokyo-sys") 
implicit val mat = FlowMaterializer() 
// sugar for runWith 
Source(1 to 3).foreach(println)
Akka Streams – Linear Flow 
val mf = Flow[Int]. 
map(_ * 2). 
runWith(Sink.foreach(println)) 
// is missing a Source, 
// can NOT run == won’t compile!
Akka Streams – Linear Flow 
val f = Flow[Int]. 
map(_ * 2). 
runWith(Sink.foreach(i => println(s"i = $i”))). 
// needs Source to run!
Akka Streams – Linear Flow 
val f = Flow[Int]. 
map(_ * 2). 
runWith(Sink.foreach(i => println(s"i = $i”))). 
// needs Source to run!
Akka Streams – Linear Flow 
val f = Flow[Int]. 
map(_ * 2). 
runWith(Sink.foreach(i => println(s"i = $i”))). 
// needs Source to run!
Akka Streams – Linear Flow 
val f = Flow[Int]. 
map(_ * 2). 
runWith(Sink.foreach(i => println(s"i = $i”))). 
// needs Source to run! 
f.connect(Source(1 to 10)).run()
Akka Streams – Linear Flow 
val f = Flow[Int]. 
map(_ * 2). 
runWith(Sink.foreach(i => println(s"i = $i”))). 
// needs Source to run! 
f.connect(Source(1 to 10)).run() 
With a Source attached… it can run()
Akka Streams – Linear Flow 
Flow[Int]. 
map(_.toString). 
runWith(Source(1 to 10), Sink.ignore) 
Connects Source and Sink, then runs
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 = ActorSubscriber( 
system.actorOf(Props[SubStreamParent], ”parent”)) 
Source(1 to 100). 
map(_.toString). 
filter(_.length == 2). 
drop(2). 
groupBy(_.last). 
runWith(subscriber)
Akka Streams <-> Actors – Advanced 
val subscriber = ActorSubscriber( 
system.actorOf(Props[SubStreamParent], ”parent”)) 
Source(1 to 100). 
map(_.toString). 
filter(_.length == 2). 
drop(2). 
groupBy(_.last). 
runWith(subscriber) 
Each “group” is a stream too! It’s a “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). 
Source 
It offers (groupKey, subStreamSource) to Subscriber
Akka Streams <-> Actors – Advanced 
groupBy(_.last). 
Source 
It can then start children, to handle the sub-flows!
Akka Streams <-> Actors – Advanced 
groupBy(_.last). 
Source 
For example, one child for each group.
Akka Streams <-> Actors – Advanced 
val subscriber = ActorSubscriber( 
system.actorOf(Props[SubStreamParent], ”parent”)) 
Source(1 to 100). 
map(_.toString). 
filter(_.length == 2). 
drop(2). 
groupBy(_.last). 
runWith(subscriber) 
The Actor, will consume SubStream offers.
Consuming streams with Actors 
(advanced)
Akka Streams <-> Actors – Advanced 
class SubStreamParent extends ActorSubscriber 
with ImplicitFlowMaterializer 
with ActorLogging { 
override def requestStrategy = OneByOneRequestStrategy 
override def receive = { 
case OnNext((groupId: String, subStream: Source[String])) => 
val subSub = context.actorOf(Props[SubStreamSubscriber], 
s"sub-$groupId") 
subStream.runWith(Sink.subscriber(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: Source[String])) => 
val subSub = context.actorOf(Props[SubStreamSubscriber], 
s"sub-$groupId") 
subStream.runWith(Sink.subscriber(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: Source[String])) => 
val subSub = context.actorOf(Props[SubStreamSubscriber], 
s"sub-$groupId") 
subStream.runWith(Sink.subscriber(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: Source[String])) => 
val subSub = context.actorOf(Props[SubStreamSubscriber], 
s"sub-$groupId") 
subStream.runWith(Sink.subscriber(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: Source[String])) => 
val subSub = context.actorOf(Props[SubStreamSubscriber], 
s"sub-$groupId") 
subStream.runWith(Sink.subscriber(ActorSubscriber(subSub))) 
} 
}
Akka Streams <-> Actors – Advanced 
class SubStreamParent extends ActorSubscriber { 
override def requestStrategy = 
WatermarkRequestStrategy(highWatermark = 10) 
override def receive = { 
case OnNext(n: String) => println(s”n = $n”) 
} 
}
Akka Streams <-> Actors – Advanced 
class SubStreamParent extends ActorSubscriber { 
override def requestStrategy = 
WatermarkRequestStrategy(highWatermark = 10) 
override def receive = { 
case OnNext(n: String) => println(s”n = $n”) 
} 
}
Akka Streams – FlowGraph 
FlowGraph
Akka Streams – FlowGraph 
Linear Flows 
or 
non-akka pipelines 
Could be another RS implementation!
Akka Streams – GraphFlow 
Fan-out elements 
and 
Fan-in elements
Akka Streams – GraphFlow 
// first define some pipeline pieces 
val f1 = Flow[Input].map(_.toIntermediate) 
val f2 = Flow[Intermediate].map(_.enrich) 
val f3 = Flow[Enriched].filter(_.isImportant) 
val f4 = Flow[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 = Source(List(3)) 
val in5 = Source(List(5)) 
val in7 = Source(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 ~> Flow[Int].grouped(1000) ~> resultFuture2 
b11 ~> m9 
b11 ~> m10 
m8 ~> m9
Akka Streams – GraphFlow 
// Third layer 
m9 ~> Flow[Int].grouped(1000) ~> resultFuture9 
m10 ~> Flow[Int].grouped(1000) ~> resultFuture10
Akka Streams – GraphFlow 
// Third layer 
m9 ~> Flow[Int].grouped(1000) ~> resultFuture9 
m10 ~> Flow[Int].grouped(1000) ~> resultFuture10
Akka Streams – GraphFlow 
// Third layer 
m9 ~> Flow[Int].grouped(1000) ~> resultFuture9 
m10 ~> Flow[Int].grouped(1000) ~> resultFuture10
Akka Streams – GraphFlow 
Sinks and Sources are “keys” 
which can be addressed within the graph 
val resultFuture2 = Sink.future[Seq[Int]] 
val resultFuture9 = Sink.future[Seq[Int]] 
val resultFuture10 = Sink.future[Seq[Int]] 
val g = FlowGraph { implicit b => 
// ... 
m10 ~> Flow[Int].grouped(1000) ~> resultFuture10 
// ... 
}.run() 
Await.result(g.get(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 = Sink.future[Seq[Int]] 
val resultFuture9 = Sink.future[Seq[Int]] 
val resultFuture10 = Sink.future[Seq[Int]] 
val g = FlowGraph { implicit b => 
// ... 
m10 ~> Flow[Int].grouped(1000) ~> resultFuture10 
// ... 
}.run() 
Await.result(g.get(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!
Available Elements 
0.9 early preview
Available Sources 
• FutureSource 
• IterableSource 
• IteratorSource 
• PublisherSource 
• SubscriberSource 
• ThunkSource 
• TickSource (timer based) 
• … easy to add your own! 
0.9 early preview
Available operations 
• drop / dropWithin 
• take / takeWithin 
• filter 
• groupBy 
• grouped 
• map 
• prefixAndTail 
• … easy to add your own! 
“Rate – detaching” operations: 
• buffer 
• collect 
• concat 
• conflate 
0.9 early preview
Available Sinks 
• BlackHoleSink 
• FoldSink 
• ForeachSink 
• FutureSink 
• OnCompleteSink 
• PublisherSink / FanoutPublisherSink 
• SubscriberSink 
• … easy to add your own! 
0.9 early preview
Available Junctions 
• Broadcast 
• Merge 
• FlexiMerge 
• Zip 
• Unzip 
• Concat 
• … easy to add your own! 
0.9 early preview
Akka-Streams 
Coming soon!
Rough plans 
• 0.9 released 
• 0.10 in 2~3 weeks 
• 1.0 “soon” after… 
• Means “stabilised APIs” 
• Will not yet be performance tuned, though it’s already 
pretty good… we know where and how we can tune it 
for 1.x. 
0.7 early preview
Java DSL 
• Partial Java DSL in 0.9 (released) 
• Full Java DSL in 0.10 (in 2~3 weeks) 
• as 1st class citizen (!) 
0.7 early preview
Spray => Akka-Http && ReactiveStreams 
Spray is now merged into Akka, as Akka-Http 
Works on Reactive Streams 
Streaming end-to-end!
Links 
• http://akka.io 
• http://reactive-streams.org 
• https://groups.google.com/group/akka-user 
• 0.7 release 
http://akka.io/news/2014/09/12/akka-streams-0.7-released.html 
• javadsl 
https://github.com/akka/akka/pulls?q=is%3Apr+javadsl
Děkuji vám! 
Dzięki! 
ありがとう! 
Ask questions, 
get Stickers! 
(for real!) 
http://akka.io 
ktoso @ typesafe.com 
twitter: ktosopl 
github: ktoso 
team blog: letitcrash.com
©Typesafe 2014 – All Rights Reserved

More Related Content

What's hot

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
 
HBase RowKey design for Akka Persistence
HBase RowKey design for Akka PersistenceHBase RowKey design for Akka Persistence
HBase RowKey design for Akka PersistenceKonrad Malawski
 
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
 
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
 
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
 
Reactive integrations with Akka Streams
Reactive integrations with Akka StreamsReactive integrations with Akka Streams
Reactive integrations with Akka StreamsKonrad 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
 
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
 
State of Akka 2017 - The best is yet to come
State of Akka 2017 - The best is yet to comeState of Akka 2017 - The best is yet to come
State of Akka 2017 - The best is yet to comeKonrad Malawski
 
How to manage large amounts of data with akka streams
How to manage large amounts of data with akka streamsHow to manage large amounts of data with akka streams
How to manage large amounts of data with akka streamsIgor Mielientiev
 
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
 
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
 
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
 
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
 
Akka streams - Umeå java usergroup
Akka streams - Umeå java usergroupAkka streams - Umeå java usergroup
Akka streams - Umeå java usergroupJohan Andrén
 
Akka Streams in Action @ ScalaDays Berlin 2016
Akka Streams in Action @ ScalaDays Berlin 2016Akka Streams in Action @ ScalaDays Berlin 2016
Akka Streams in Action @ ScalaDays Berlin 2016Konrad Malawski
 
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
 
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
 
Real-time streaming and data pipelines with Apache Kafka
Real-time streaming and data pipelines with Apache KafkaReal-time streaming and data pipelines with Apache Kafka
Real-time streaming and data pipelines with Apache KafkaJoe Stein
 

What's hot (20)

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
 
Akka streams
Akka streamsAkka streams
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
 
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...
 
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
 
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
 
Reactive integrations with Akka Streams
Reactive integrations with Akka StreamsReactive integrations with Akka Streams
Reactive integrations with Akka Streams
 
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...
 
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
 
State of Akka 2017 - The best is yet to come
State of Akka 2017 - The best is yet to comeState of Akka 2017 - The best is yet to come
State of Akka 2017 - The best is yet to come
 
How to manage large amounts of data with akka streams
How to manage large amounts of data with akka streamsHow to manage large amounts of data with akka streams
How to manage large amounts of data with akka streams
 
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
 
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
 
VJUG24 - Reactive Integrations with Akka Streams
VJUG24  - Reactive Integrations with Akka StreamsVJUG24  - Reactive Integrations with Akka Streams
VJUG24 - Reactive Integrations with Akka Streams
 
Reactive stream processing using Akka streams
Reactive stream processing using Akka streams Reactive stream processing using Akka streams
Reactive stream processing using Akka streams
 
Akka streams - Umeå java usergroup
Akka streams - Umeå java usergroupAkka streams - Umeå java usergroup
Akka streams - Umeå java usergroup
 
Akka Streams in Action @ ScalaDays Berlin 2016
Akka Streams in Action @ ScalaDays Berlin 2016Akka Streams in Action @ ScalaDays Berlin 2016
Akka Streams in Action @ ScalaDays Berlin 2016
 
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
 
Building reactive distributed systems with Akka
Building reactive distributed systems with Akka Building reactive distributed systems with Akka
Building reactive distributed systems with Akka
 
Real-time streaming and data pipelines with Apache Kafka
Real-time streaming and data pipelines with Apache KafkaReal-time streaming and data pipelines with Apache Kafka
Real-time streaming and data pipelines with Apache Kafka
 

Viewers also liked

DDDing Tools = Akka Persistence
DDDing Tools = Akka PersistenceDDDing Tools = Akka Persistence
DDDing Tools = Akka PersistenceKonrad 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
 
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
 
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
 
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
 
[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 Need for Async @ ScalaWorld
The Need for Async @ ScalaWorldThe Need for Async @ ScalaWorld
The Need for Async @ ScalaWorldKonrad Malawski
 
Disrupt 2 Grow - Devoxx 2013
Disrupt 2 Grow - Devoxx 2013Disrupt 2 Grow - Devoxx 2013
Disrupt 2 Grow - Devoxx 2013Konrad 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, j.u.concurrent & Beyond!
Reactive Streams, j.u.concurrent & Beyond!Reactive Streams, j.u.concurrent & Beyond!
Reactive Streams, j.u.concurrent & Beyond!Konrad 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
 
Functor, Apply, Applicative And Monad
Functor, Apply, Applicative And MonadFunctor, Apply, Applicative And Monad
Functor, Apply, Applicative And MonadOliver Daff
 
Disrupt yourself
Disrupt yourselfDisrupt yourself
Disrupt yourselfAdam Harper
 
IGNITE@UxPA2012- The Y-Factor: How a 20-something can be a UX leader
IGNITE@UxPA2012- The Y-Factor: How a 20-something can be a UX leaderIGNITE@UxPA2012- The Y-Factor: How a 20-something can be a UX leader
IGNITE@UxPA2012- The Y-Factor: How a 20-something can be a UX leaderMotivate Design
 
To disrupt or be disrupted world disrupt forum aug 2016 - ambition
To disrupt or be disrupted   world disrupt forum aug 2016 - ambitionTo disrupt or be disrupted   world disrupt forum aug 2016 - ambition
To disrupt or be disrupted world disrupt forum aug 2016 - ambitionAmbition Group
 
EVOLVE & DISRUPT (Agileee 2015)
EVOLVE & DISRUPT (Agileee 2015) EVOLVE & DISRUPT (Agileee 2015)
EVOLVE & DISRUPT (Agileee 2015) Arthur Lokaychuk
 
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
 

Viewers also liked (20)

DDDing Tools = Akka Persistence
DDDing Tools = Akka PersistenceDDDing Tools = Akka Persistence
DDDing Tools = Akka Persistence
 
The Cloud-natives are RESTless @ JavaOne
The Cloud-natives are RESTless @ JavaOneThe Cloud-natives are RESTless @ JavaOne
The Cloud-natives are RESTless @ JavaOne
 
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
 
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
 
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
 
[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 Need for Async @ ScalaWorld
The Need for Async @ ScalaWorldThe Need for Async @ ScalaWorld
The Need for Async @ ScalaWorld
 
Disrupt 2 Grow - Devoxx 2013
Disrupt 2 Grow - Devoxx 2013Disrupt 2 Grow - Devoxx 2013
Disrupt 2 Grow - Devoxx 2013
 
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, j.u.concurrent & Beyond!
Reactive Streams, j.u.concurrent & Beyond!Reactive Streams, j.u.concurrent & Beyond!
Reactive Streams, j.u.concurrent & Beyond!
 
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?"
 
Zen of Akka
Zen of AkkaZen of Akka
Zen of Akka
 
Functor, Apply, Applicative And Monad
Functor, Apply, Applicative And MonadFunctor, Apply, Applicative And Monad
Functor, Apply, Applicative And Monad
 
Disrupt yourself
Disrupt yourselfDisrupt yourself
Disrupt yourself
 
IGNITE@UxPA2012- The Y-Factor: How a 20-something can be a UX leader
IGNITE@UxPA2012- The Y-Factor: How a 20-something can be a UX leaderIGNITE@UxPA2012- The Y-Factor: How a 20-something can be a UX leader
IGNITE@UxPA2012- The Y-Factor: How a 20-something can be a UX leader
 
To disrupt or be disrupted world disrupt forum aug 2016 - ambition
To disrupt or be disrupted   world disrupt forum aug 2016 - ambitionTo disrupt or be disrupted   world disrupt forum aug 2016 - ambition
To disrupt or be disrupted world disrupt forum aug 2016 - ambition
 
EVOLVE & DISRUPT (Agileee 2015)
EVOLVE & DISRUPT (Agileee 2015) EVOLVE & DISRUPT (Agileee 2015)
EVOLVE & DISRUPT (Agileee 2015)
 
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)
 

Similar to Reactive Streams / Akka Streams - GeeCON Prague 2014

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
 
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
 
Intro to Reactive Thinking and RxJava 2
Intro to Reactive Thinking and RxJava 2Intro to Reactive Thinking and RxJava 2
Intro to Reactive Thinking and RxJava 2JollyRogers5
 
Building Stateful Microservices With Akka
Building Stateful Microservices With AkkaBuilding Stateful Microservices With Akka
Building Stateful Microservices With AkkaYaroslav Tkachenko
 
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.
 
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 programming for java developers
Reactive programming for java developersReactive programming for java developers
Reactive programming for java developersConstantin Popa
 
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
 
Reactive streams processing using Akka Streams
Reactive streams processing using Akka StreamsReactive streams processing using Akka Streams
Reactive streams processing using Akka StreamsJohan Andrén
 
Reactive Streams - László van den Hoek
Reactive Streams - László van den HoekReactive Streams - László van den Hoek
Reactive Streams - László van den HoekRubiX BV
 
Asynchronous Architectures for Implementing Scalable Cloud Services - Evan Co...
Asynchronous Architectures for Implementing Scalable Cloud Services - Evan Co...Asynchronous Architectures for Implementing Scalable Cloud Services - Evan Co...
Asynchronous Architectures for Implementing Scalable Cloud Services - Evan Co...Twilio Inc
 
Akka stream and Akka CQRS
Akka stream and  Akka CQRSAkka stream and  Akka CQRS
Akka stream and Akka CQRSMilan Das
 
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
 
Introduction to Akka Streams [Part-II]
Introduction to Akka Streams [Part-II]Introduction to Akka Streams [Part-II]
Introduction to Akka Streams [Part-II]Knoldus Inc.
 
Serverless and Streaming: Building ‘eBay’ by ‘Turning the Database Inside Out’
Serverless and Streaming: Building ‘eBay’ by ‘Turning the Database Inside Out’ Serverless and Streaming: Building ‘eBay’ by ‘Turning the Database Inside Out’
Serverless and Streaming: Building ‘eBay’ by ‘Turning the Database Inside Out’ confluent
 
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
 
Akka Streams - From Zero to Kafka
Akka Streams - From Zero to KafkaAkka Streams - From Zero to Kafka
Akka Streams - From Zero to KafkaMark Harrison
 
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
 
Buiilding reactive distributed systems with Akka
Buiilding reactive distributed systems with AkkaBuiilding reactive distributed systems with Akka
Buiilding reactive distributed systems with AkkaJohan Andrén
 

Similar to Reactive Streams / Akka Streams - GeeCON Prague 2014 (20)

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
 
Intro to Akka Streams
Intro to Akka StreamsIntro to Akka Streams
Intro to 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
 
Intro to Reactive Thinking and RxJava 2
Intro to Reactive Thinking and RxJava 2Intro to Reactive Thinking and RxJava 2
Intro to Reactive Thinking and RxJava 2
 
Building Stateful Microservices With Akka
Building Stateful Microservices With AkkaBuilding Stateful Microservices With Akka
Building Stateful Microservices With Akka
 
Introduction to Akka Streams [Part-I]
Introduction to Akka Streams [Part-I]Introduction to Akka Streams [Part-I]
Introduction to Akka Streams [Part-I]
 
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 programming for java developers
Reactive programming for java developersReactive programming for java developers
Reactive programming for java developers
 
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...
 
Reactive streams processing using Akka Streams
Reactive streams processing using Akka StreamsReactive streams processing using Akka Streams
Reactive streams processing using Akka Streams
 
Reactive Streams - László van den Hoek
Reactive Streams - László van den HoekReactive Streams - László van den Hoek
Reactive Streams - László van den Hoek
 
Asynchronous Architectures for Implementing Scalable Cloud Services - Evan Co...
Asynchronous Architectures for Implementing Scalable Cloud Services - Evan Co...Asynchronous Architectures for Implementing Scalable Cloud Services - Evan Co...
Asynchronous Architectures for Implementing Scalable Cloud Services - Evan Co...
 
Akka stream and Akka CQRS
Akka stream and  Akka CQRSAkka stream and  Akka CQRS
Akka stream and Akka CQRS
 
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...
 
Introduction to Akka Streams [Part-II]
Introduction to Akka Streams [Part-II]Introduction to Akka Streams [Part-II]
Introduction to Akka Streams [Part-II]
 
Serverless and Streaming: Building ‘eBay’ by ‘Turning the Database Inside Out’
Serverless and Streaming: Building ‘eBay’ by ‘Turning the Database Inside Out’ Serverless and Streaming: Building ‘eBay’ by ‘Turning the Database Inside Out’
Serverless and Streaming: Building ‘eBay’ by ‘Turning the Database Inside Out’
 
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...
 
Akka Streams - From Zero to Kafka
Akka Streams - From Zero to KafkaAkka Streams - From Zero to Kafka
Akka Streams - From Zero to Kafka
 
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
 
Buiilding reactive distributed systems with Akka
Buiilding reactive distributed systems with AkkaBuiilding reactive distributed systems with Akka
Buiilding reactive distributed systems with Akka
 

More from Konrad Malawski

Akka Typed (quick talk) - JFokus 2018
Akka Typed (quick talk) - JFokus 2018Akka Typed (quick talk) - JFokus 2018
Akka Typed (quick talk) - JFokus 2018Konrad Malawski
 
ScalaSwarm 2017 Keynote: Tough this be madness yet theres method in't
ScalaSwarm 2017 Keynote: Tough this be madness yet theres method in'tScalaSwarm 2017 Keynote: Tough this be madness yet theres method in't
ScalaSwarm 2017 Keynote: Tough this be madness yet theres method in'tKonrad Malawski
 
Not Only Streams for Akademia JLabs
Not Only Streams for Akademia JLabsNot Only Streams for Akademia JLabs
Not Only Streams for Akademia JLabsKonrad Malawski
 
Krakow communities @ 2016
Krakow communities @ 2016Krakow communities @ 2016
Krakow communities @ 2016Konrad 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
 
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
 

More from Konrad Malawski (7)

Akka Typed (quick talk) - JFokus 2018
Akka Typed (quick talk) - JFokus 2018Akka Typed (quick talk) - JFokus 2018
Akka Typed (quick talk) - JFokus 2018
 
ScalaSwarm 2017 Keynote: Tough this be madness yet theres method in't
ScalaSwarm 2017 Keynote: Tough this be madness yet theres method in'tScalaSwarm 2017 Keynote: Tough this be madness yet theres method in't
ScalaSwarm 2017 Keynote: Tough this be madness yet theres method in't
 
Not Only Streams for Akademia JLabs
Not Only Streams for Akademia JLabsNot Only Streams for Akademia JLabs
Not Only Streams for Akademia JLabs
 
Krakow communities @ 2016
Krakow communities @ 2016Krakow communities @ 2016
Krakow communities @ 2016
 
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
 
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
 

Recently uploaded

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
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
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
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 

Recently uploaded (20)

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
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
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
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
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
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
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
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 

Reactive Streams / Akka Streams - GeeCON Prague 2014

  • 1. Konrad 'ktoso' Malawski GeeCON 2014 @ Kraków, PL Akka Streams Konrad `@ktosopl` Malawski OST: Tomas Dvorak ./‘ ./‘
  • 2. hAkker @ Konrad `@ktosopl` Malawski Akka Team, Reactive Streams TCK
  • 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
  • 7. You? ? z ? ?
  • 8. You? ? z ? ? ?
  • 11. Streams “You cannot enter the same river twice” ~ Heraclitus http://en.wikiquote.org/wiki/Heraclitus
  • 12. 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
  • 15. Reactive Streams Back-pressured Stream processing
  • 16. Reactive Streams Back-pressured Asynchronous Stream processing
  • 17. Reactive Streams Back-pressured Asynchronous Stream processing Standardised (!)
  • 18. Reactive Streams: Goals 1. Back-pressured Asynchronous Stream processing 2. Standard implemented by many libraries
  • 19. Reactive Streams - Specification & TCK http://reactive-streams.org
  • 20. 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
  • 21. Reactive Streams - Inter-op We want to make different implementations co-operate with each other. http://reactive-streams.org
  • 22. Reactive Streams - Inter-op The different implementations “talk to each other” using the Reactive Streams protocol. http://reactive-streams.org
  • 23. 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
  • 25. Back-pressure? Example Without Publisher[T] Subscriber[T]
  • 26. Back-pressure? Example Without Fast Publisher Slow Subscriber
  • 27. Back-pressure? “Why would I need that!?”
  • 28. Back-pressure? Push + NACK model
  • 29. Back-pressure? Push + NACK model Subscriber usually has some kind of buffer.
  • 30. Back-pressure? Push + NACK model
  • 31. Back-pressure? Push + NACK model
  • 32. Back-pressure? Push + NACK model What if the buffer overflows?
  • 33. Back-pressure? Push + NACK model (a) Use bounded buffer, drop messages + require re-sending
  • 34. Back-pressure? Push + NACK model (a) Use bounded buffer, drop messages + require re-sending Kernel does this! Routers do this! (TCP)
  • 35. Back-pressure? Push + NACK model (b) Increase buffer size… Well, while you have memory available!
  • 36. Back-pressure? Push + NACK model (b)
  • 39. Back-pressure? Example NACKing Buffer overflow is imminent!
  • 40. Back-pressure? Example NACKing Telling the Publisher to slow down / stop sending…
  • 41. Back-pressure? Example NACKing NACK did not make it in time, because M was in-flight!
  • 43. Back-pressure? Fast Subscriber, No Problem No problem!
  • 44. Back-pressure? Reactive-Streams = “Dynamic Push/Pull”
  • 45. Back-pressure? RS: Dynamic Push/Pull Just push – not safe when Slow Subscriber Just pull – too slow when Fast Subscriber
  • 46. Back-pressure? RS: Dynamic Push/Pull Just push – not safe when Slow Subscriber Just pull – too slow when Fast Subscriber Solution: Dynamic adjustment
  • 47. Back-pressure? RS: Dynamic Push/Pull Slow Subscriber sees it’s buffer can take 3 elements. Publisher will never blow up it’s buffer.
  • 48. Back-pressure? RS: Dynamic Push/Pull Fast Publisher will send at-most 3 elements. This is pull-based-backpressure.
  • 49. Back-pressure? RS: Dynamic Push/Pull Fast Subscriber can issue more Request(n), before more data arrives!
  • 50. Back-pressure? RS: Dynamic Push/Pull Fast Subscriber can issue more Request(n), before more data arrives. Publisher can accumulate demand.
  • 51. Back-pressure? RS: Accumulate demand Publisher accumulates total demand per subscriber.
  • 52. Back-pressure? RS: Accumulate demand Total demand of elements is safe to publish. Subscriber’s buffer will not overflow.
  • 53. Back-pressure? RS: Requesting “a lot” Fast Subscriber can issue arbitrary large requests, including “gimme all you got” (Long.MaxValue)
  • 54. Back-pressure? RS: Dynamic Push/Pull MAX speed
  • 55. Back-pressure? RS: Dynamic Push/Pull Easy MAX speed
  • 56. How does fit all this?
  • 57. Akka Akka has multiple modules: akka-actor: actors (concurrency abstraction) akka-camel: integration akka-remote: remote actors akka-cluster: clustering akka-persistence: CQRS / Event Sourcing akka-streams: stream processing …
  • 58. Akka Akka is a high-performance concurrency library for Scala and Java. At it’s core it focuses on the Actor Model:
  • 59. 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 and receive messages • Create Actors • Change it’s behaviour
  • 60. Akka class Player extends Actor { def receive = { case NextTurn => sender() ! decideOnMove() } def decideOnMove(): Move = ??? }
  • 61. Akka Akka has multiple modules: akka-actor: actors (concurrency abstraction) akka-camel: integration akka-remote: remote actors akka-cluster: clustering akka-persistence: CQRS / Event Sourcing akka-streams: stream processing …
  • 62. Akka Streams 0.9 early preview
  • 63. Akka Streams – Linear Flow
  • 64. Akka Streams – Linear Flow
  • 65. Akka Streams – Linear Flow
  • 66. Akka Streams – Linear Flow
  • 67. Akka Streams – Linear Flow Flow[Double].map(_.toInt). [...] No Source attached yet. “Pipe ready to work with Doubles”.
  • 68. Akka Streams – Linear Flow implicit val sys = ActorSystem("tokyo-sys") An ActorSystem is the world in which Actors live in. AkkaStreams uses Actors, so it needs ActorSystem.
  • 69. Akka Streams – Linear Flow implicit val sys = ActorSystem("tokyo-sys") implicit val mat = FlowMaterializer() Contains logic on HOW to materialise the stream.
  • 70. Akka Streams – Linear Flow implicit val sys = ActorSystem("tokyo-sys") implicit val mat = FlowMaterializer() A materialiser chooses HOW to materialise a Stream. The Flow’s AST is fully “lifted”. The Materialiser can choose to materialise the Flow in any way it sees fit. Our implementation uses Actors. But you could easily plug in an SparkMaterializer!
  • 71. Akka Streams – Linear Flow implicit val sys = ActorSystem("tokyo-sys") implicit val mat = FlowMaterializer() You can configure it’s buffer sizes etc.
  • 72. Akka Streams – Linear Flow implicit val sys = ActorSystem("tokyo-sys") implicit val mat = FlowMaterializer() val foreachSink = Sink.foreach[Int](println) val mf = Source(1 to 3).runWith(foreachSink)
  • 73. Akka Streams – Linear Flow implicit val sys = ActorSystem("tokyo-sys") implicit val mat = FlowMaterializer() val foreachSink = Sink.foreach[Int](println) val mf = FlowFrom(1 to 3).runWith(foreachSink)(mat) Uses the implicit FlowMaterializer
  • 74. Akka Streams – Linear Flow implicit val sys = ActorSystem("tokyo-sys") implicit val mat = FlowMaterializer() // sugar for runWith Source(1 to 3).foreach(println)
  • 75. Akka Streams – Linear Flow val mf = Flow[Int]. map(_ * 2). runWith(Sink.foreach(println)) // is missing a Source, // can NOT run == won’t compile!
  • 76. Akka Streams – Linear Flow val f = Flow[Int]. map(_ * 2). runWith(Sink.foreach(i => println(s"i = $i”))). // needs Source to run!
  • 77. Akka Streams – Linear Flow val f = Flow[Int]. map(_ * 2). runWith(Sink.foreach(i => println(s"i = $i”))). // needs Source to run!
  • 78. Akka Streams – Linear Flow val f = Flow[Int]. map(_ * 2). runWith(Sink.foreach(i => println(s"i = $i”))). // needs Source to run!
  • 79. Akka Streams – Linear Flow val f = Flow[Int]. map(_ * 2). runWith(Sink.foreach(i => println(s"i = $i”))). // needs Source to run! f.connect(Source(1 to 10)).run()
  • 80. Akka Streams – Linear Flow val f = Flow[Int]. map(_ * 2). runWith(Sink.foreach(i => println(s"i = $i”))). // needs Source to run! f.connect(Source(1 to 10)).run() With a Source attached… it can run()
  • 81. Akka Streams – Linear Flow Flow[Int]. map(_.toString). runWith(Source(1 to 10), Sink.ignore) Connects Source and Sink, then runs
  • 82. 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()
  • 83. Akka Streams <-> Actors – Advanced val subscriber = ActorSubscriber( system.actorOf(Props[SubStreamParent], ”parent”)) Source(1 to 100). map(_.toString). filter(_.length == 2). drop(2). groupBy(_.last). runWith(subscriber)
  • 84. Akka Streams <-> Actors – Advanced val subscriber = ActorSubscriber( system.actorOf(Props[SubStreamParent], ”parent”)) Source(1 to 100). map(_.toString). filter(_.length == 2). drop(2). groupBy(_.last). runWith(subscriber) Each “group” is a stream too! It’s a “Stream of Streams”.
  • 85. Akka Streams <-> Actors – Advanced groupBy(_.last). GroupBy groups “11” to group “1”, “12” to group “2” etc.
  • 86. Akka Streams <-> Actors – Advanced groupBy(_.last). Source It offers (groupKey, subStreamSource) to Subscriber
  • 87. Akka Streams <-> Actors – Advanced groupBy(_.last). Source It can then start children, to handle the sub-flows!
  • 88. Akka Streams <-> Actors – Advanced groupBy(_.last). Source For example, one child for each group.
  • 89. Akka Streams <-> Actors – Advanced val subscriber = ActorSubscriber( system.actorOf(Props[SubStreamParent], ”parent”)) Source(1 to 100). map(_.toString). filter(_.length == 2). drop(2). groupBy(_.last). runWith(subscriber) The Actor, will consume SubStream offers.
  • 90. Consuming streams with Actors (advanced)
  • 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: Source[String])) => val subSub = context.actorOf(Props[SubStreamSubscriber], s"sub-$groupId") subStream.runWith(Sink.subscriber(ActorSubscriber(subSub))) } }
  • 92. Akka Streams <-> Actors – Advanced class SubStreamParent extends ActorSubscriber with ImplicitFlowMaterializer with ActorLogging { override def requestStrategy = OneByOneRequestStrategy override def receive = { case OnNext((groupId: String, subStream: Source[String])) => val subSub = context.actorOf(Props[SubStreamSubscriber], s"sub-$groupId") subStream.runWith(Sink.subscriber(ActorSubscriber(subSub))) } }
  • 93. Akka Streams <-> Actors – Advanced class SubStreamParent extends ActorSubscriber with ImplicitFlowMaterializer with ActorLogging { override def requestStrategy = OneByOneRequestStrategy override def receive = { case OnNext((groupId: String, subStream: Source[String])) => val subSub = context.actorOf(Props[SubStreamSubscriber], s"sub-$groupId") subStream.runWith(Sink.subscriber(ActorSubscriber(subSub))) } }
  • 94. Akka Streams <-> Actors – Advanced class SubStreamParent extends ActorSubscriber with ImplicitFlowMaterializer with ActorLogging { override def requestStrategy = OneByOneRequestStrategy override def receive = { case OnNext((groupId: String, subStream: Source[String])) => val subSub = context.actorOf(Props[SubStreamSubscriber], s"sub-$groupId") subStream.runWith(Sink.subscriber(ActorSubscriber(subSub))) } }
  • 95. Akka Streams <-> Actors – Advanced class SubStreamParent extends ActorSubscriber with ImplicitFlowMaterializer with ActorLogging { override def requestStrategy = OneByOneRequestStrategy override def receive = { case OnNext((groupId: String, subStream: Source[String])) => val subSub = context.actorOf(Props[SubStreamSubscriber], s"sub-$groupId") subStream.runWith(Sink.subscriber(ActorSubscriber(subSub))) } }
  • 96. Akka Streams <-> Actors – Advanced class SubStreamParent extends ActorSubscriber { override def requestStrategy = WatermarkRequestStrategy(highWatermark = 10) override def receive = { case OnNext(n: String) => println(s”n = $n”) } }
  • 97. Akka Streams <-> Actors – Advanced class SubStreamParent extends ActorSubscriber { override def requestStrategy = WatermarkRequestStrategy(highWatermark = 10) override def receive = { case OnNext(n: String) => println(s”n = $n”) } }
  • 98. Akka Streams – FlowGraph FlowGraph
  • 99. Akka Streams – FlowGraph Linear Flows or non-akka pipelines Could be another RS implementation!
  • 100. Akka Streams – GraphFlow Fan-out elements and Fan-in elements
  • 101. Akka Streams – GraphFlow // first define some pipeline pieces val f1 = Flow[Input].map(_.toIntermediate) val f2 = Flow[Intermediate].map(_.enrich) val f3 = Flow[Enriched].filter(_.isImportant) val f4 = Flow[Intermediate].mapFuture(_.enrichAsync) // then add input and output placeholders val in = SubscriberSource[Input] val out = PublisherSink[Enriched]
  • 102. Akka Streams – GraphFlow
  • 103. 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 = Source(List(3)) val in5 = Source(List(5)) val in7 = Source(List(7))
  • 104. Akka Streams – GraphFlow
  • 105. Akka Streams – GraphFlow // First layer in7 ~> b7 b7 ~> m11 b7 ~> m8 in5 ~> m11 in3 ~> b3 b3 ~> m8 b3 ~> m10
  • 106. Akka Streams – GraphFlow // Second layer m11 ~> b11 b11 ~> Flow[Int].grouped(1000) ~> resultFuture2 b11 ~> m9 b11 ~> m10 m8 ~> m9
  • 107. Akka Streams – GraphFlow // Third layer m9 ~> Flow[Int].grouped(1000) ~> resultFuture9 m10 ~> Flow[Int].grouped(1000) ~> resultFuture10
  • 108. Akka Streams – GraphFlow // Third layer m9 ~> Flow[Int].grouped(1000) ~> resultFuture9 m10 ~> Flow[Int].grouped(1000) ~> resultFuture10
  • 109. Akka Streams – GraphFlow // Third layer m9 ~> Flow[Int].grouped(1000) ~> resultFuture9 m10 ~> Flow[Int].grouped(1000) ~> resultFuture10
  • 110. Akka Streams – GraphFlow Sinks and Sources are “keys” which can be addressed within the graph val resultFuture2 = Sink.future[Seq[Int]] val resultFuture9 = Sink.future[Seq[Int]] val resultFuture10 = Sink.future[Seq[Int]] val g = FlowGraph { implicit b => // ... m10 ~> Flow[Int].grouped(1000) ~> resultFuture10 // ... }.run() Await.result(g.get(resultFuture2), 3.seconds).sorted should be(List(5, 7))
  • 111. Akka Streams – GraphFlow Sinks and Sources are “keys” which can be addressed within the graph val resultFuture2 = Sink.future[Seq[Int]] val resultFuture9 = Sink.future[Seq[Int]] val resultFuture10 = Sink.future[Seq[Int]] val g = FlowGraph { implicit b => // ... m10 ~> Flow[Int].grouped(1000) ~> resultFuture10 // ... }.run() Await.result(g.get(resultFuture2), 3.seconds).sorted should be(List(5, 7))
  • 112. Akka Streams – GraphFlow val g = FlowGraph {} FlowGraph is immutable and safe to share and re-use!
  • 113. Available Elements 0.9 early preview
  • 114. Available Sources • FutureSource • IterableSource • IteratorSource • PublisherSource • SubscriberSource • ThunkSource • TickSource (timer based) • … easy to add your own! 0.9 early preview
  • 115. Available operations • drop / dropWithin • take / takeWithin • filter • groupBy • grouped • map • prefixAndTail • … easy to add your own! “Rate – detaching” operations: • buffer • collect • concat • conflate 0.9 early preview
  • 116. Available Sinks • BlackHoleSink • FoldSink • ForeachSink • FutureSink • OnCompleteSink • PublisherSink / FanoutPublisherSink • SubscriberSink • … easy to add your own! 0.9 early preview
  • 117. Available Junctions • Broadcast • Merge • FlexiMerge • Zip • Unzip • Concat • … easy to add your own! 0.9 early preview
  • 119. Rough plans • 0.9 released • 0.10 in 2~3 weeks • 1.0 “soon” after… • Means “stabilised APIs” • Will not yet be performance tuned, though it’s already pretty good… we know where and how we can tune it for 1.x. 0.7 early preview
  • 120. Java DSL • Partial Java DSL in 0.9 (released) • Full Java DSL in 0.10 (in 2~3 weeks) • as 1st class citizen (!) 0.7 early preview
  • 121. Spray => Akka-Http && ReactiveStreams Spray is now merged into Akka, as Akka-Http Works on Reactive Streams Streaming end-to-end!
  • 122. Links • http://akka.io • http://reactive-streams.org • https://groups.google.com/group/akka-user • 0.7 release http://akka.io/news/2014/09/12/akka-streams-0.7-released.html • javadsl https://github.com/akka/akka/pulls?q=is%3Apr+javadsl
  • 123. Děkuji vám! Dzięki! ありがとう! Ask questions, get Stickers! (for real!) http://akka.io ktoso @ typesafe.com twitter: ktosopl github: ktoso team blog: letitcrash.com
  • 124. ©Typesafe 2014 – All Rights Reserved