Professional Documents
Culture Documents
akka streams,
Alpakka and Kafka
Stream
akka streams
Asynchronous back pressured stream processing
Source
Sink
Flow
akka streams
Asynchronous back pressured stream processing
Source
(possible)
asynchronous
boundaries
Flow
Sink
akka streams
Asynchronous back pressured stream processing
Source
10 msg/s
Sink
Flow
1 msg/s
OutOfMemoryError!!
akka streams
Asynchronous back pressured stream processing
Source
10 msg/s
1 msg/s
hand me 3 more
Sink
Flow
1 msg/s
hand me 3 more
akka streams
Not only linear streams
Source
Flow
Flow
Source
Flow
Sink
Sink
Reactive
And the many meanings it carries.
reactivemanifesto.org
Not-quite-Reactive-System
The reason we started researching
into transparent to users flow control.
Reactive Streams
Reactive Streams is an initiative to provide a standard for
asynchronous stream processing with non-blocking back
pressure. This encompasses eorts aimed at runtime
environments as well as network protocols
http://www.reactive-streams.org
Reactive Streams
A buiding-block of Reactive Systems, not the entire story.
Reactive Streams
Reactive Streams is an initiative to provide a standard for
asynchronous stream processing with non-blocking back
pressure. This encompasses eorts aimed at runtime
environments as well as network protocols
http://www.reactive-streams.org
Part of JDK 9
java.util.concurrent.Flow
http://openjdk.java.net/projects/jdk9/
JEP-266 soon!
public final class Flow {
private Flow() {} // uninstantiable
@FunctionalInterface
public static interface Publisher<T> {
public void subscribe(Subscriber<? super T> subscriber);
}
public static
public void
public void
public void
public void
}
interface Subscriber<T> {
onSubscribe(Subscription subscription);
onNext(T item);
onError(Throwable throwable);
onComplete();
Reactive Streams
RS Library A
RS library B
async
boundary
Reactive Streams
RS Library A
RS library B
async
boundary
Make building powerful concurrent &
distributed applications simple.
Akka Streams
The API
RunnableGraph<NotUsed> runnable =
source.via(flow).to(sink);
runnable.run(materializer);
CompletionStage<String> firstString =
Source.single(1)
.map(n -> n.toString())
.runWith(Sink.head(), materializer);
// types:
_
Source<Int, NotUsed>
Flow<Int, String, NotUsed>
Sink<String, CompletionStage<String>>
// types:
_
Source<Int, NotUsed>
Flow<Int, String, NotUsed>
Sink<String, CompletionStage<String>>
Materialization
Alpakka
http://blog.akka.io/integrations/2016/08/23/intro-alpakka
http://developer.lightbend.com/docs/alpakka/current/
o
m
e
D
streams
& HTTP
http://doc.akka.io/docs/akka/2.4/scala/stream/stream-customize.html#graphstage-scala
Framed entity streaming
http://doc.akka.io/docs/akka/2.4/java/http/routing-dsl/source-streaming-support.html
http://doc.akka.io/docs/akka/2.4/scala/stream/stream-customize.html#graphstage-scala
Framed entity streaming
http://doc.akka.io/docs/akka/2.4/java/http/routing-dsl/source-streaming-support.html
xkcd.com
Mailing list:
https://groups.google.com/group/akka-user
Public chat rooms:
http://gitter.im/akka/dev developing Akka
http://gitter.im/akka/akka using Akka
More resources:
Read more tutorials and deep-dives:
http://blog.akka.io/
https://www.lightbend.com/resources
Reactive Platform
Reactive Platform
Reactive Platform
Further reading:
Reactive Streams: reactive-streams.org
Akka documentation: akka.io/docs
Free OReilly report bit.ly/why-reactive
Example Sources:
ktoso/akka-streams-alpakka-talk-demos-2016
Contact:
Konrad ktoso@lightbend.com Malawski
http://kto.so / @ktosopl
Thanks!
Questions?
@ktosopl konrad.malawski@lightbend.com
@apnylle johan.andren@lightbend.com