This session is focused on Alpakka. In this, I'm going to explain how Alpakka makes it easy to do enterprise-level integrations with Akka-Streams and how it makes streaming data from different outer sources much easier.
2. Lack of etiquette and manners is a huge turn off.
Remote KnolX Etiquettes
Punctuality
Respect Knolx session timings, you
are requested not to join sessions
after a 5 minutes threshold post
the session start time.
Feedback
Make sure to submit a constructive
feedback for all sessions as it is
very helpful for the presenter.
Turn off your microphone.
Keep your windows on mute.
3. Our Agenda
● Introduction to Reactive Streams
● Introduction to Akka Streams
● What is Alpakka
● Need for Alpakka
● Kafka to ES and Cassandra
● Demo
4. Brief About Reactive Streams
Reactive Streams is an initiative to
provide a standard for
asynchronous stream processing
with non-blocking back pressure.
T
● Asynchronous Stream
Processing
● Non-blocking Back-pressured
5. . ● Stream is basically a sequence of data
that can be infinite.
● Processing a stream is termed as
Stream Processing.
● Asynchronous means that publisher
and consumer are not synced with
each other with a clock.
● Asynchronous processing is required to
enable parallel use of computer
resources.
Asynchronous
Stream
Processing
6. A way for consumers of data to notify the producers
about their current availability
Back Pressure
7. Need for Reactive Streams
. ● Handling Streams of data-specially live data whose size is not predetermined.-requires special
care in an asynchronous system.
● To govern the exchange of stream data across an asynchronous boundary - like passing elements
on to another thread or thread-pool.
● The most prominent issue is resource consumption needs to be controlled such that a fast data
source does not overwhelm the stream destination i.e maintaining the back-pressure.
8. Introduction to Akka-Streams
● Entry point to your
stream.
● Sources receive
demand from
downstream.
● Can receive data from
file, database,
collection etc.
.
Akka Stream is a module built on top of Akka actors to make the ingestion and processing of data easy.
It implement an asynchronous, non-blocking and back-pressured protocol.
● The flow is a
processing step within
the stream.
● It combines one
incoming channel and
one outgoing channel
as well as some
transformation of the
messages passing
through it.
● Exit point of your
stream.
● Sink send
demand to the
source.
● Can write data to
a file, database,
collection etc.
9. What is Alpakka?
.
Alpakka is an open source project, that is built on
top of Akka-Streams.
It provide a DSL for reactive and stream-oriented
programming.
You can use Java and Scala as well.
It has built-in support for backpressure to handle
the flow of data.
Alpakka provides us a number of connectors to
integrate akka-streams with different
technologies.
Insert Your Subtitle Here
10. Need of Alpakka
● Akka-Streams does not provide built-in Sources/Sinks/Flows to connect
with different end points.
● If you want to connect external data stores/queue in Akka-Streams you
will have to do coding for that yourself and it would be much more
complex.
● Alpakka comes to rescue in that situation.
12. Alpakka Kafka
The Alpakka Kafka connector was originally known as Reactive Kafka or even as
Akka-Streams Kafka.
It let’s you connect Apache Kafka with Akka Streams.
Dependency
libraryDependencies += "com.typesafe.akka" %% "akka-stream-kafka" % "2.0.3"
13.
14. Alpakka Cassandra
The Alpakka Cassandra provides a connector to connect Cassandra with Akka-Streams.
Dependency
libraryDependencies += "com.lightbend.akka" %% "akka-stream-alpakka-cassandra" %
"2.0.0"
15. Alpakka Elasticsearch
This is an implementation of Akka-Streams with Elasticsearch. It basically provides us connectors
to connect elasticsearch with akka-streams.
Dependency
libraryDependencies += "com.lightbend.akka" %% "akka-stream-alpakka-elasticsearch" % "2.0.0"