Akka Streams processes data through asynchronous pipelines while preventing a fast producer from overwhelming a slower consumer. Its backpressure model lets downstream consumers signal how much data they can handle before upstream producers send it. section 10.1
A basic stream is assembled from three stages:
- Source produces elements. section 16.0
- Flow transforms elements as they pass through. section 16.0
- Sink consumes the resulting elements. section 16.0
A persistence-to-view pipeline
A stream can read events from a persistence journal, transform or enrich them, and write results into another table to create a view. A similar Flow API pipeline can read from Kafka, enrich events through an external service, and publish them back to Kafka. section 10.0 section 16.0
The consumer-signaling diagram shows how downstream demand controls upstream delivery and makes backpressure concrete. section 10.1
The Flow API handles simple linear pipelines. More complex arrangements use GraphDSL to combine streams into graphs, while GraphStage provides the lower-level composition API used to build the other two layers. section 16.0
