Summary

Traditional streaming solutions suffer from one of two issues. In the case of pulling, there is a need for locking or extensive use of resources on the side of the quick consumer. In the case of pushing, there is a possibility that a number of messages to process will grow bigger than the available memory, requiring a slow consumer to drop messages or terminate because of the memory overflow. Reactive Streams solves this problem by defining dynamic asynchronous pull-push with back pressure. Akka Streams implements the Reactive Streams standard using Akka which allows for seamless integration with both technologies.

Streams in Akka are built from blocks called stages or flows. These blocks can be nested and connected to each other, forming graphs. Graphs with single input and single output can be made runnable by connecting them to the source and sink. Graph definitions can be freely shared and reused.

Running a graph requires a materializer and produces a materialized value depending on the graph and sink definition.

Error handling in Akka Streams can be done in different ways including catching errors directly in the flow definition, defining a recovery method with optional retries and/or overriding a supervision strategy for processing stages which support it.

The modular nature of the flow definition allows for straightforward testing of single stages and their combinations. In order to reduce boilerplate for recurring test setup and expectation definitions, Akka Streams offers special test toolkit.

The reader is encouraged to take a look at the official Akka documentation at https://doc.akka.io/docs/akka/current/stream/index.html to explore the possibilities offered by Akka Streams in more detail.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.119.142.85